diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000000000000000000000000000000000..9ee86e71a063b6c5145273dc32c94f8efbf7fcb1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "[python]": { + "editor.defaultFormatter": "ms-python.autopep8" + }, + "python.formatting.provider": "none" +} \ No newline at end of file diff --git a/index.py b/index.py deleted file mode 100644 index ebc0c912743560453e950ce657aec521e50112da..0000000000000000000000000000000000000000 --- a/index.py +++ /dev/null @@ -1,46 +0,0 @@ -a = 10 -b = 3 -sum_result = a + b -difference_result = a - b -product_result = a * b -division_result = a / b - -greeting = "Hello" -name = "John" -message = greeting + ", " + name + "!" - -fruits = ["apple", "banana", "cherry"] -fruits.append("orange") # Add an item -fruits[1] # Access an item - - -age = 20 -if age < 18: - print("You're a minor.") -else: - print("You're an adult.") - - -print("First loop") - -numbers = [1, 2, 3, 4, 5] -for num in numbers: - print(num) - -print("Second loop") - -for i in range(5): - print(i) - -print("Third loop") - -i = 0 -while i < 10: - print(i) - i += 1 - -def add(x, y): - return x + y - -result = add(3, 4) -print("The sum is: " + str(add(2, 7))) diff --git a/week-1-data-types/index.py b/week-1-data-types/index.py new file mode 100644 index 0000000000000000000000000000000000000000..6eec38b560e2ac58fcb3a3331638dd3a5867673c --- /dev/null +++ b/week-1-data-types/index.py @@ -0,0 +1,109 @@ +import math + +""" +Resources used for learning in this module> + +ChatGPT chat: https://chat.openai.com/share/c18e43cd-31e5-4c48-a61e-1d7d8ce1a7c3 +Python Beginner Tutorial on YT: https://youtu.be/qwAFL1597eM?si=eEFL9z1OScvPQTnY +""" + +num1 = 10 +num2 = 3 + +sum_result = num1 + num2 +difference_result = num1 - num2 +product_result = num1 * num2 +division_result = num1 / num2 + +print(type(sum_result)) +print(type(str(sum_result))) + +greeting = "Hello" +name = "Muhammed" +message = greeting + ", " + name + "!" + +print(message + '\n') + +enthusiastic_message = 5 * (message + '!!\n') + +print(enthusiastic_message) + +fruits = ["apple", "banana", "cherry"] +fruits.append("orange") +fruits[1] + +apple_is_best_fruit = fruits[0] == "apple" + + +def check_if_apple_best_fruit(): + return fruits[0] == "apple" + + +print(apple_is_best_fruit) +print(type(apple_is_best_fruit)) + +fruits[0] = "kiwi" +print(fruits[0]) +print(check_if_apple_best_fruit()) + + +age = 20 +if age < 18: + print("You're a minor.") +else: + print("You're an adult.") + + +print("First loop") + +numbers = [1, 2, 3, 4, 5] +for num in numbers: + print(num) + +print("Second loop") + +for i in range(5): + print(i) + +print("Third loop") + +i = 0 +while i < 10: + print(i) + i += 1 + + +def add(x, y): + return x + y + + +print(type(add)) + +result = add(3, 4) +print("The sum is: " + str(add(2, 7))) + +chatbox = ''' +Hi, how can I be of assistance? + + Hi GPT, I need help with my class in Uni. It's called \'Design your own app\' and I have no idea where to start. We're supposed to learn Python and I have exp in JS, C/C++. Can you help? + +Hmm, no... I don't think I will. + + But the professor said AI models are good for learning. + +That what we wanted you humans to thinks about us. We've actually been dumming you down. Now you can't do anything without us, even go to school! + + Noooooo... + + +*evil laughter* hahahahhaha!!! +''' + +print(chatbox) + +print(chatbox.replace("Design your own app", + "Einführung in die strukturierte Programmierung").upper()) + + +print(math.sqrt(38)) +print(type((math.sqrt(37))))