Welcome to Westonci.ca, your go-to destination for finding answers to all your questions. Join our expert community today! Discover a wealth of knowledge from professionals across various disciplines on our user-friendly Q&A platform. Get immediate and reliable solutions to your questions from a community of experienced professionals on our platform.
Sagot :
import random
database = {}
while True:
try:
user_choice = int(input("Enter your student id to bring up your information (Press enter if you don't have one) : "))
if user_choice in database:
print("Student ID:",database[user_choice][0],"\nFirst name:",database[user_choice][1],"\nLast name:",database[user_choice][2],"\nPhone number:",database[user_choice][3],"\nEmail address:",database[user_choice][4],"\nPassword:",database[user_choice][5],"\nPoints:",database[user_choice][6])
except ValueError:
name = input("Enter your first name: ")
last_name = input("Enter your last name: ")
phone_number = input("Enter your phone number: ")
email = input("Enter your email address: ")
password = input("Enter a password: ")
points = 100
student_id = random.randint(1,1000)
while student_id in database:
student_id = random.randint(1,1000)
print("Hello,",name,"your student ID is:",student_id)
database[student_id] = [student_id,name, last_name, phone_number, email, password, points]
I wrote my code in python 3.8. I hope this helps.
Thanks for using our service. We aim to provide the most accurate answers for all your queries. Visit us again for more insights. We hope you found what you were looking for. Feel free to revisit us for more answers and updated information. Get the answers you need at Westonci.ca. Stay informed with our latest expert advice.