pamalau

Untitled

Feb 10th, 2019
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. from random import randint
  2.  
  3. def muffet():
  4.     print("Little Miss Muffet, Sat on a tuffet, Eating her curds and whey;")
  5.     print("Along came a spider, Who sat down beside her, and frightened Miss Muffet away")
  6. def happy_birthday(name):
  7.     print("Happy Birthday to You")
  8.     print("Happy Birthday to You")
  9.     print("Happy Birthday Dear " + name)
  10.     print("Happy Birthday to You.")
  11. #Password function based on printable ascii characters.    
  12. def password(len):
  13.     pwd = ""
  14.     for p in range(len):
  15.         ascii_num = randint(33,126)
  16.         #exclude some confusing characters
  17.         while ( (ascii_num in range(44,47)) or (ascii_num in range(94,97)) ):
  18.             ascii_num = randint(33,128)
  19.         pwd = pwd + chr(ascii_num)
  20.     return pwd  
  21. muffet()
  22. happy_birthday("Frank")
  23. print("Password = : " + password((16)))
Add Comment
Please, Sign In to add comment