so I recently started out in python, and I'm looking around the internet for answers. Whenever I copy and paste the following code from a different thread, it always seems to work:
import os
import time
#Must Access this to continue.
def main():
while True:
UserName = input ("Enter Username: ")
PassWord = input ("Enter Password: ")
if UserName == 'Bob' and PassWord == 'rainbow123':
time.sleep(1)
print ("Login successful!")
logged()
else:
print ("Password did not match!")
def logged():
time.sleep(1)
print ("Welcome to ----")
main()
It works even when I rename the variables etc etc, however when retyping it myself, I have discovered that no matter what i try it never actually seems to work. This is what I tried:
import os
import time
welcomeMessage = "Welcome to free bitcoin application."
print (welcomeMessage)
time.sleep(1)
# userName = igoo
# passWord = b
def begin():
userName = input("Please enter your username...")
passWord = input("Please enter your passowrd...")
if userName == "igoo" or "igor" or "Igoo" or "Igor" and passWord == "b" or "B":
print: ("Welcome along.")
logged()
else:
print ("Wrong password")
time.sleep(1)
def logged():
time.sleep(1)
print("Alright you in.")
begin()
So any Idea what I'm doing wrong? I've tried several things but none of them seem to work. I understand most people will just shrug it off and say that this is the most simple thing ever and that I shouldn't even bother, but I really want to get this right. I want to continue developing this into a website cloner but only after the login bit, however for now I only wish to finish the login bit.
Any help is much appreciated.