forked from NorthcoteHS/gitTask
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateAccount.py
More file actions
53 lines (43 loc) · 2.19 KB
/
createAccount.py
File metadata and controls
53 lines (43 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
'''
Prog: createAccount.py
Name: Jodie, Allen, Elyse, and Denny
Date: 2018-01-29
Desc: This program handles the creation of new user accounts on the dating app. Users will complete a user profile to help them match with others.
'''
# Initialise list of users.
users = []
# User must choose a username.
username=input("Choose a user name: ")
# If the username is taken, ask for a different one.
#This will need to be changed so that it actually includes the list of registered users. As it is, it will always start off blank.
while username in users:
print("That username is already taken!")
username=input("Choose a different user name: ")
users = users.append(username)
# User must choose a password.
#This is not very secure. We should research safer ways to handle user log-in details.
password = input("Set a password: ")
# If the user's password isn't long enough, ask them to choose a different one.
while len(password) < 8:
print("Password must be at least 8 characters!")
password = input("Set a longer password: ")
# Here, the user indicates his/her species and gender.
# Are we being inclusive here? Do we need to offer more options?
userSpecies = input("Please enter your species: ")
userGender = input("Please enter your gender: ")
# Initialise user's list of interests (animal species and gender).
userInterests = []
# Instruct user on how to answer yes/no questions.
print("Please answer each of the following questions with y or n so we can narrow the options to your interests.")
# This series of questions allows users to indicate interest in different species. Choices are added to their list of interests.
speciesList = ["dogs", "cats", "birds", "fish", "bunnies", "other species"]
for s in speciesList:
interest = input("Are you interested in meeting " + s + "? ")
if interest and interest[0].lower() == "y":
userInterests.append(s)
# This series of questions allows users to indicate interest in different genders. Choices are added to their list of interests.
genderList = ["good girls", "good boys", "any gender"]
for g in genderList:
interest = input("Are you interested in meeting " + g + "? ")
if interest and interest[0].lower() == "y":
userInterests.append(g)