PageRenderTime 55ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/username.py

https://bitbucket.org/jcsims/book
Python | 18 lines | 8 code | 5 blank | 5 comment | 0 complexity | 791476f956bada7fb8a5ba33fe42ee62 MD5 | raw file
  1. # username.py
  2. # A simple program to generate usernames
  3. def main():
  4. print "This program generates user names."
  5. print
  6. # get user's first and last names
  7. first = raw_input("Please enter your first name (all lowercase): ")
  8. last = raw_input("Please enter your last name (all lowercase): ")
  9. # cocatenate first initial with 7 chars of the last name
  10. uname = first[0] + last[:7]
  11. # Output the username
  12. print "Your username is", uname
  13. main()