|
1 | | -# PasswordGenerator GGearing314 01/10/19 |
2 | | -from random import * |
| 1 | +# PasswordGenerator GGearing 314 01/10/19 |
| 2 | +# modified Prince Gangurde 4/4/2020 |
| 3 | + |
| 4 | +from random import randint |
3 | 5 |
|
4 | 6 | case = randint(1, 2) |
5 | 7 | number = randint(1, 99) |
| 8 | + |
| 9 | +specialCharacters = ( "!", "@", "#", "$", "%", "/", "?", ":" , "<", ">", "|" , "&", "*", "-", "=", "+", "_") |
| 10 | + |
6 | 11 | animals = ( |
7 | 12 | "ant", "alligator", "baboon", "badger", "barb", "bat", "beagle", "bear", "beaver", "bird", "bison", "bombay", "bongo", |
8 | 13 | "booby", "butterfly", "bee", "camel", "cat", "caterpillar", "catfish", "cheetah", "chicken", "chipmunk", "cow", "crab", |
9 | 14 | "deer", "dingo", "dodo", "dog", "dolphin", "donkey", "duck", "eagle", "earwig", "elephant", "emu", "falcon", "ferret", |
10 | 15 | "fish", "flamingo", "fly", "fox", "frog", "gecko", "gibbon", "giraffe", "goat", "goose", "gorilla") |
| 16 | + |
11 | 17 | colour = ( |
12 | 18 | "red", "orange", "yellow", "green", "blue", "indigo", "violet", "purple", "magenta", "cyan", "pink", "brown", "white", |
13 | 19 | "grey", "black") |
14 | | -chosenanimal = animals[randint(0, len(animals))] |
15 | | -chosencolour = colour[randint(0, len(colour))] |
| 20 | + |
| 21 | +chosenanimal = animals[randint(0, len(animals) - 1)] # randint will return max lenght but , tuple has index from 0 to len-1 |
| 22 | +chosencolour = colour[randint(0, len(colour) - 1)] |
| 23 | +chosenSpecialCharacter = specialCharacters[randint(0, len(specialCharacters) - 1)] |
| 24 | + |
16 | 25 | if case == 1: |
17 | 26 | chosenanimal = chosenanimal.upper() |
18 | | - print(chosencolour, number, chosenanimal) |
| 27 | + print(chosencolour, number , chosenanimal, chosenSpecialCharacter) |
19 | 28 | else: |
20 | 29 | chosencolour = chosencolour.upper() |
21 | | - print(chosenanimal, number, chosencolour) |
22 | | -# print("This program has exatly ",(len(animals)*len(colour)*99*2),"different combinations") #I'm not sure this is right |
23 | | -input("Press enter to close...") |
| 30 | + print(chosenanimal, number, chosencolour, chosenSpecialCharacter) |
0 commit comments