book /username.py

Language Python Lines 19
MD5 Hash 791476f956bada7fb8a5ba33fe42ee62 Estimated Cost $170 (why?)
Repository https://bitbucket.org/jcsims/book View Raw File
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# username.py
#	A simple program to generate usernames

def main():
	print "This program generates user names."
	print

	# get user's first and last names
	first = raw_input("Please enter your first name (all lowercase): ")
	last = raw_input("Please enter your last name (all lowercase): ")

	# cocatenate first initial with 7 chars of the last name
	uname = first[0] + last[:7]

	# Output the username
	print "Your username is", uname

main()
Back to Top