Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #python
- #3/13/18 (F Day)
- #python
- #uppercase + lowercase math loop HW
- import string #access to string functions
- def login():
- username = raw_input("Enter Username: ")
- print string.upper(username) #makes username all uppercase
- password = raw_input("Enter Password: ")
- print string.lower(password) #makes password all lowercase
- login()
- print "\nPowers of 2 from 1-20:" #title of assignment
- value = 2 #base number is 2
- n = 1 #starting exponent
- while n != 21:
- print(str(value)+ "^" + str(n) + " ="),
- print (value ** n)
- n += 1 #continuous loop until condition is met
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement