print ("Welcome teaacher")
while True:
Class = input("Which class (1, 2 or 3) would you like to look at?")
if Class.lower() not in ('1', '2', '3'):
print("Not an appropriate choice.")
else:
break
while True:
print("Which method would you like to view by?")
Method = input("Type '1' for average, '2' for highest score or '3' for alphabetical")
if Class.lower() not in ('1', '2', '3'):
print("Not an appropriate choice.")
else:
break
if Method == 1:
print("You have chosen Class" +Class+ " average")
if Method == 2:
print("You have chosen Class" +Class+ " highest score")
if Method == 3:
print("You have chosen Class" +Class+ " alphabetical")
Seçtiğim şeyi bana anlatmaya çalıştığım için kod almaya çalışıyorum ama sonuçta if ifadeleri olup olmadığını ve hiçbir şey yazdırmıyor.basic Python ifadeleri yüklenmiyorsa
Herhangi bir yardım
girintinizi lütfen düzeltin ve daha iyi [MCVE] sağlar:
Burada gibi görünmesini gereken bu. – idjaw
Olası kopyası [Python'da Elit cümlesi açıklanırken] (http://stackoverflow.com/questions/3295938/else-clause-on-python-while-statement) – usr2564301
Yinelenen işaretler * asla * kesilir “True” satırları (asla bir False durumuna ulaşmayacaktır). Belki de '' ile '' burada 'if' ile eşleştirmek istediniz? – usr2564301