PDA

View Full Version : I got it working



EnderDas
03-21-2016, 03:40 PM
I finally got my python code to work I just wasn't using the right syntax -_-


data1 = input("please enter new username : ")
print("username now registered")
data2 = input("UserName : ")
if (data2==data1):
print("username correct!...")
else:
print("incorrect username?...")
data2 = input("UserName : ")
if (data2==data1):
print("username correct!...")
else:
quit()

input("__")


It's used to register a user name and save it
Only works once

PiZaHuTt
03-21-2016, 03:40 PM
What is this

Acrystic
03-21-2016, 03:43 PM
I finally got my python code to work I just wasn't using the right syntax -_-


data1 = input("please enter new username : ")
print("username now registered")
data2 = input("UserName : ")
if (data2==data1):
print("username correct!...")
else:
print("incorrect username?...")
data2 = input("UserName : ")
if (data2==data1):
print("username correct!...")
else:
quit()

input("__")


It's used to register a user name and save it
Only works once

What is this. I know it's python though..

EnderDas
03-21-2016, 04:01 PM
What is this. I know it's python though..
enter it into a console to see ;)

|ThyLuigi|
03-21-2016, 07:10 PM
Now here's a challenge: save the username and password into a text file so they can log into it later.

MyLegGuy
03-21-2016, 07:25 PM
You can do a while loop or something to get unlimited tries to enter the username.



data1 = input("please enter new username : ")
print("username now registered")
data2 = input("UserName : ")
while (data2!=data1):
print("incorrect username?...")
data2 = input("UserName : ")
print("username corect!...")
input("__")

EnderDas
03-21-2016, 08:15 PM
Now here's a challenge: save the username and password into a text file so they can log into it later.
Ight.... I'll try

EnderDas
03-21-2016, 11:34 PM
well i made a new version of it, its only missing the security questions test



#UserName & PassWord + SQ's
#By EnderDas
print('the system exits after two failed atempts...')
data = input("Please enter new Username : ")
print('Username', data,'now registered!...')
data1 = input("Please enter new PassWord : ")
print('Password', data1,'now registered!...')
input("Now for Security Questions. Press enter to continue...")
dat1 = input("Favorite game? : ")
dat2 = input("First Pet? : ")
dat3 = input("Dark or Milk Coco? : ")
print('all Questions have been saved!...')
#---------------------------TEST-----------------------------
data2 = input("UserName : ")
if (data2==data):
print('UserName Valid!...')
else:
print('UserName Invalid?...')
data2 = input("UserName : ")
if (data2==data):
print('UserName Valid!...')
else:
print('UserName Invalid?...\nOops too many failed atempts, Good Bye!... ')

data3 = input("PassWord : ")
if (data3==data1):
print('Password Valid!...\nWelcome back', data,'!')
else:
print('PassWord Invalid?...')
data3 = input("PassWord : ")
if (data3==data1):
print('Password Valid!...\nWelcome back', data,'!')
else:
print('PassWord Invalid?...\nOops too many failed atempts, Good Bye!... ')

#Ill Post the Questions later my hands are tired from typing -_- .....
input("__")

also the invalid username and passwords are bugged because ive used to many spaces could some one fix that for me plzzzzz

|ThyLuigi|
03-21-2016, 11:53 PM
well i made a new version of it, its only missing the security questions test



#UserName & PassWord + SQ's
#By EnderDas
print('the system exits after two failed atempts...')
data = input("Please enter new Username : ")
print('Username', data,'now registered!...')
data1 = input("Please enter new PassWord : ")
print('Password', data1,'now registered!...')
input("Now for Security Questions. Press enter to continue...")
dat1 = input("Favorite game? : ")
dat2 = input("First Pet? : ")
dat3 = input("Dark or Milk Coco? : ")
print('all Questions have been saved!...')
#---------------------------TEST-----------------------------
data2 = input("UserName : ")
if (data2==data):
print('UserName Valid!...')
else:
print('UserName Invalid?...')
data2 = input("UserName : ")
if (data2==data):
print('UserName Valid!...')
else:
print('UserName Invalid?...\nOops too many failed atempts, Good Bye!... ')

data3 = input("PassWord : ")
if (data3==data1):
print('Password Valid!...\nWelcome back', data,'!')
else:
print('PassWord Invalid?...')
data3 = input("PassWord : ")
if (data3==data1):
print('Password Valid!...\nWelcome back', data,'!')
else:
print('PassWord Invalid?...\nOops too many failed atempts, Good Bye!... ')

#Ill Post the Questions later my hands are tired from typing -_- .....
input("__")

also the invalid username and passwords are bugged because ive used to many spaces could some one fix that for me plzzzzz
Your invalid usernames and passwords don't exit the program either. :]
(Psss...do raise SystemExit)

EnderDas
03-22-2016, 01:52 AM
Your invalid usernames and passwords don't exit the program either. :]
(Psss...do raise SystemExit)

Ahhh that's what it is omg thank you