I'm a web development student, and we are currently studying python as part of our school agenda.
I DON'T UNDERSTAND ANYTHING!!!
The best I can do is build a simple calculator but give me anything more complicated and my brain will literally shit itself.
For example, we were tasked to create a program that will show you however many numbers of the Fibonacci succession you tell it to show. And you might say "but u/weebmaster32, that shit's dead easy!", and you may be right, but I don't even know how to tell python to express the Fibonacci succession, let alone how to make it so it only shows as many numbers as the user tells it to.
Here's the code that I found for it in a tutorial:
number = int(input("How many numbers would you like to see?: "))n1 = 0n2 = 1print(n1)print(n2)for i in range(number):
# Where the fuck does the "i" come from, and what does it do? What is the range and why are we looking for a "range" inside the number variable?
n3 = n1 + n2print(n3) n1 = n2 n2 = n3
Here's another task we were given: "Create a program that requests the user to input an email adress, and checks whether the format of said adress is valid or not. (We all know what most email adresses look like)"
Here's the code that either one of my classmates, or my teacher wrote (i don't remember who did it):
posAt = 0validEmail = Falsewhile not validEmail:
#Why say while "not" validEmail? mail = input("Type a valid email adress: ")
if mail.find("@") > 0: posAt = mail.find("@")if mail.find(".") < len(mail) -1 and mail.find(".") > posAt and (mail.find('@') - mail.find(".")) > 1: validEmail = True#by the way, this whole last section of code is like gibberish to me
if not validEmail:print(mail + " IS NOT a valid email adress")else:print(mail + " IS a valid email adress")
I hope someone here is able to tell me of a good way to understand it because all I've managed to do for the past week is waste time and get frustrated, while most of my classmates got it during the first day.