I want to make a game that allows users to make a log in which requires them to make a username and password,I will then give them an option whether they woul like to register or log in.This is where I am stuggling as I dont know how to save their log in and then make it re appear when they choose to register with their log in.I dont know if this makes sense but it would really help if you could suggest a solution,i have inserted a bit of my code.

   name=input("Please enter your name ")
    age=input("Please enter your age ")
    print("Hello" + name)
    username=name+age
    print("Your username is" +username)

Recommended Answers

A few things. There are examples about this at https://www.google.com/search?client=opera&q=python+sql+example+login+name+password

next, you need to read the next link to see how these forums work.
Read https://www.daniweb.com/programming/threads/435023/read-this-before-posting-a-question

Jump to Post

All 2 Replies

name = ['shiv','deepak','baldev','shishupal','raj','depanshu','balram','shivani','shweta','deepika','manisha','shruti']
email = ['shiv123','deepak123','baldev123','shishupal123','raj123','depanshu123','balram123','shivani123','shweta123','deepika123','manisha123','shruti123']
psk = ['shiv123','deepak123','baldev123','shishupal123','raj123','depanshu123','balram123','shivani123','shweta123','deepika123','manisha123','shruti123']

nam = input("Enter your name : ")

if nam in name :
  print ("Welcome "+nam+".")

  em = input("Please enter your email id : ")

  if em in email:
    print ("Welcome : " +em )

    passkey = input("Please enter your password : ")

    if passkey in psk :
      print ("Welcome "+nam+" Nice to meet you again...")

    else:
      print("Wrong Credential !")

  else:
      print("Wrong Credential !")

else:
      print("Wrong Credential !")

I have do this in python 3.6.1 version you can try.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.