I'm new to Python and only started learning a couple months ago. I get that this is a really unsophisticated code and I'm a newbie, but are there any blatant issues with it that I can improve upon? I just kind of threw everything I know together to see if I'm cut out for this kind of thing.
Also I'm a first time poster so I do apologize in advance if something is not said with etiquette.
# Attempts to respond to all possible inputs
# This block just asks the user's name
print('Hello!\nMy name is Monty!')
print("\nWhat's your name?")
user_name = input() # I want to eventually import some sort of 'autocorrect' library if that exists
print(f'\nHi {user_name.title()}!')
print('Nice to meet you.\n')
# This block asks the user's fav color
favorite_color = input('What is your favorite color or colors?\n')
print('\n'+favorite_color[0].upper() + favorite_color[1:].lower(), 'just happens to be my favorite too!')
print('Amazing!\n')
# This block contains lists for later use
yes_list = ['yes', 'Yes', 'y', 'Y', 'yeah', 'Yeah', 'ye', 'Ye', 'yes please', 'yes, please', 'sure', 'Sure',
'of course', 'of course!', 'definitely', 'Definitely']
no_list = ['no', 'No', 'n', 'N', 'nah', 'Nah', 'nope', 'Nope', 'no thanks',
'No thanks', 'No, thanks', 'No, thank you', 'no thank you.', 'no, thank you']
dog_list = ['dog', 'Dog', 'the dog', 'The dog', 'doggie', 'Doggie', 'a dog']
cat_list = ['cat', 'Cat', 'the cat', 'The cat', 'kittie', 'Kittie']
mouse_list = ['mouse', 'Mouse', ' the mouse', 'The mouse', 'mousy', 'Mousy']
draw_list = ['draw', 'Draw', 'DRAW', 'please draw', 'Please draw', 'PLEASE DRAW',
'draw please', 'Draw please', 'DRAW PLEASE', 'draw, please', 'Draw, please']
emptyAnimal_list = []
newEmptyAnimal_list = []
animalsNotViewed_list = []
animalListContents = ['> dog drawing', '> cat drawing', '> mouse drawing']
are_ya_sure = ['No']
separator = ''
# This block asks the user if they want the program to draw
print('I can draw a dog, a cat, or a mouse, ya know!')
print('Do you want me to draw one?')
start = 0
while start == 0: # Primary while loop
drawing_decision = input()
if drawing_decision in dog_list or drawing_decision in cat_list or drawing_decision in mouse_list: # User must say something in yes or no list first
print("\nYes or no please! Try again.")
continue # Brings to the top of primary while loop
elif drawing_decision not in dog_list and drawing_decision not in cat_list and drawing_decision not in mouse_list\
and drawing_decision not in yes_list and drawing_decision not in no_list: # If user types another animal, it will reject
print('\nI can only draw a dog, cat, or mouse!')
if drawing_decision in yes_list: # If user responds correctly, enter secondary while loop
animal_selection = 0
while animal_selection == 0:
print("\nWhich one do you want me to draw?")
animal_selection = input()
if animal_selection in dog_list: # If user responds dog, print dog
print('\nHere I go!\nBam:')
print(''' ㅤ / ̄ ̄ヽ_
/^ヽ ・ ●
|# | __ノ
`―-)=( / ̄\/ ̄\
/ㅤ ) l | |
c( ノ \ /
_」 LL_ \ /
(__)_)''')
print("It's Snoopy!\n")
print('Do you want me to draw any other one?')
emptyAnimal_list.append('> dog drawing') # Append to empty list for later
other_animals = input() # Do you want to draw another one?
if other_animals in yes_list:
animal_selection = 0
elif other_animals in no_list: # If not, thank them and list drawings viewed
if '> dog drawing' in emptyAnimal_list and '> cat drawing' in emptyAnimal_list \
and '> mouse drawing' in emptyAnimal_list:
print('\nI hope you enjoyed my 3 drawings!')
print("They're not the best, but they're the only 3 I can draw, for I am a lowly automaton!")
emptyAnimal_list.append('> dog drawing')
break
else:
print('\nI hope you enjoyed my:\n')
for x in emptyAnimal_list:
if x not in newEmptyAnimal_list:
newEmptyAnimal_list.append(x)
print('\n'.join(newEmptyAnimal_list))
print(f"\nI'm able to draw 3 but at least you saw {len(newEmptyAnimal_list)} of them!")
for x in animalListContents:
if x not in newEmptyAnimal_list:
animalsNotViewed_list.append(x)
print("I hope you're able to see my:\n")
print('\n'.join(animalsNotViewed_list),'\n')
print('Next time!')
elif other_animals in dog_list or other_animals in cat_list or other_animals in mouse_list: # If user enters an accepted animal before yes or no, reprimand and continue
print("Yes or no next time! But go ahead:")
animal_selection = 0
else: # If user asks to draw an unaccepted animal
animal_selection = 1
print('I can only draw a dog, cat, or mouse!')
while animal_selection == 1:
animal_selection = 0
elif animal_selection in cat_list: # If user responds cat, print cat
print('\nHere I go!\nBam:')
print(''' /> フ
| _ _|
/` ミ_xノ
/ |
/ ヽ ノ
│ | | |
/ ̄| | | |
( ̄ヽ__ヽ_)__)
\二)''')
print("Meow\n")
print('Do you want me to draw any other one?')
emptyAnimal_list.append('> cat drawing') # Append to empty list for later
other_animals = input() # Do you want to draw another one?
if other_animals in yes_list:
animal_selection = 0
elif other_animals in no_list: # If not, thank them and list drawings viewed
if '> dog drawing' in emptyAnimal_list and '> cat drawing' in emptyAnimal_list \
and '> mouse drawing' in emptyAnimal_list:
print('\nI hope you enjoyed my 3 drawings!')
print("They're not the best, but they're the only 3 I can draw, for I am a lowly automaton!")
emptyAnimal_list.append('> cat drawing')
break
else:
print('\nI hope you enjoyed my:\n')
for x in emptyAnimal_list:
if x not in newEmptyAnimal_list:
newEmptyAnimal_list.append(x)
print('\n'.join(newEmptyAnimal_list))
print(f"\nI'm able to draw 3 but at least you saw {len(newEmptyAnimal_list)} of them!")
for x in animalListContents:
if x not in newEmptyAnimal_list:
animalsNotViewed_list.append(x)
print("I hope you're able to see my:\n")
print('\n'.join(animalsNotViewed_list),'\n')
print('Next time!')
elif other_animals in dog_list or other_animals in cat_list or other_animals in mouse_list: # If user enters an accepted animal before yes or no, reprimand and continue
print("Yes or no next time! But go ahead:")
animal_selection = 0
else: # If user asks to draw an unaccepted animal
animal_selection = 1
print('I can only draw a dog, cat, or mouse!')
while animal_selection == 1:
animal_selection = 0
elif animal_selection in mouse_list: # If user responds mouse, print mouse
print('\nHere I go!\nBam:')
print(r''' .-"""-.
/ \
.-"""-.-`.-.-.</ _
/ _,-\ ()()_/:)
\ / , ` `|
'-..-| \-.,___, /
\ `-.__/ /
`-.__.-'`''')
print("It's Mickey!\n")
print('Do you want me to draw any other one?')
emptyAnimal_list.append('> mouse drawing') # Append to empty list for later
other_animals = input() # Do you want to draw another one?
if other_animals in yes_list:
animal_selection = 0
elif other_animals in no_list: # If not, thank them and list drawings viewed
if '> dog drawing' in emptyAnimal_list and '> cat drawing' in emptyAnimal_list \
and '> mouse drawing' in emptyAnimal_list:
print('\nI hope you enjoyed my 3 drawings!')
print("They're not the best, but they're the only 3 I can draw, for I am a lowly automaton!")
emptyAnimal_list.append('> mouse drawing')
break
else:
print('\nI hope you enjoyed my:\n')
for x in emptyAnimal_list:
if x not in newEmptyAnimal_list:
newEmptyAnimal_list.append(x)
print('\n'.join(newEmptyAnimal_list))
print(f"\nI'm able to draw 3 but at least you saw {len(newEmptyAnimal_list)} of them!")
for x in animalListContents:
if x not in newEmptyAnimal_list:
animalsNotViewed_list.append(x)
print("I hope you're able to see my:\n")
print('\n'.join(animalsNotViewed_list),'\n')
print('Next time!')
elif other_animals in dog_list or other_animals in cat_list or other_animals in mouse_list: # If user enters an accepted animal before yes or no, reprimand and continue
print("Yes or no next time! But go ahead:")
animal_selection = 0
else: # If user asks to draw an unaccepted animal
animal_selection = 1
print('I can only draw a dog, cat, or mouse!')
while animal_selection == 1:
animal_selection = 0
elif animal_selection in no_list: # If user says no during 'which drawing' question
print("\nAre you sure you don't want to see any of my drawings?")
confirmation = 0
while confirmation == 0:
confirmation = input()
if confirmation in yes_list: # Exits this block
print(f'\nSorry you feel that way {user_name}!')
break
elif confirmation in no_list: # Returns to animal selection
print('\nOK!')
animal_selection = 0
break
else: # Asks exit confirmation question again
print("\nI'm not sure I understood. Do you want to leave or not?")
confirmation = 0
else: # If user asks to draw an unaccepted animal
animal_selection = 1
print('I can only draw a dog, cat, or mouse!')
while animal_selection == 1:
animal_selection = 0
print('\nGreat meeting you', user_name.title() + '!') # If user says no during additional drawing question
elif drawing_decision in no_list: # If user says no during first question regarding drawing
no_draw = 1
while no_draw == 1:
if no_draw == 1:
are_ya_sure.append('?')
print(separator.join(are_ya_sure))
print('\nAll ya gotta do is say "yes."')
break
no_draw = 1