-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathlesson-six.py
More file actions
52 lines (36 loc) · 1.32 KB
/
lesson-six.py
File metadata and controls
52 lines (36 loc) · 1.32 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
users = []
# complete this function so that it returns a dict with the properties
# name, email, and password
def buildUser(name, email, password) :
# your code here
# complete this function so that it passes the parameteres from here
# to buildUser and appends what buildUser returns to users
def addUser(name, email, password) :
# your code here
# complete this function so that it prints "User's name: <users name>"
# for each user in users
def printNames() :
# your code here
# complete this function so that we add a property with the key
# 'createdDate' and the value date provided in the parameters to each
# user in users
def addCreatedDate(date) :
# your code here
# BONUS: complete this function so that if a user's email is longer than
# 20 characters we print it
def findLongEmails() :
# your code here
##-----##
addUser("Johnny Mosely", "jmosely@alpenglow.com", "jmosely")
addUser("Adrien Bellinger", "abellinger@alpenglow.com", "abell")
addUser("Jimmy Chin", "jchin@thenorthface.com", "jchin")
addUser("Tommy Caldwell", "tcaldwell@thenorthface.com", "tcald")
addUser("Dan Schulman", "dan@paypal.com", "dscul")
print("\nPrinting Names\n")
printNames()
addCreatedDate("April 15, 2020")
print("\nPrinting Users\n")
for user in users :
print(user)
print("\nPrinting Long Emails\n")
findLongEmails()