+ 2
Pycharm not allowing defining variables under if statements.
choice_1 = input("\n Choose a letter. \n A: AAA \n B: BBB \n") if choice_1 == 'A': print("XYZ") choice_2 = input("A: ABC \n B: DEF \n C: GHI \n") if choice_2 == 'A': print("XYZ") elif choice_2 == 'B': print("UVW") elif choice_2 == 'C': print("RST") else: print("That is not a choice") Pycharm tells me that variable choice_2 not defined, but this works in IDLE and Sololearn playground. thanks everyone!
4 Respostas
0
try printf
0
For indentation, use tab
0
So what would be the correct way to write it?
0
Hmm... depends. When you sort out this problem, will this be the final product?