我是一個剛剛開始編碼4-5周前的新手編碼器。我所取得的最好成績是一個「絕密」網站的基本Python用戶名和密碼登錄頁面(網站是假的)。然而,爲了讓我更加了解基本編碼(我最近一直在做一些不相關的事情),我試着製作一個基本的兒童遊戲來處理字母表。這是我現在的代碼:爲什麼這些參數不適用於Python 3?
name = input("What's Your Name?: ")
print("Welcome" , name , "to the 3 lucky guess alphabet skills builder!")
print("Let's get started:")
C = input("What Is The 3rd Letter of The Alphabet: ")
if C == 'C' or 'c':
print("Congraulations!")
else:
print("Think We Should Retry That!")
C
if C == 'C' or 'c':
print("That's Better!")
Z = input("What Is The Last Letter of The Alphabet: ")
if Z == 'Z' or 'z':
print("You're Really Good At This! One More!")
else:
print("Have Another Go!")
Z
if Z == 'Z' or 'z':
print("That's More Like It! Last One!")
J = input("What Is The 10th Letter Of The Alphabet: ")
if J == 'J' or 'j':
print("Great! How Many Did You Get In Total?")
else:
print("Unlucky, Better Luck Next Time!")
total = input("How Many Did You Get In Total?: " , print("Out Of 3!")
print("Wow! You Got" , total , "! Well Done" , name , "!!!")
exit
爲什麼沒有任何'其他'的參數工作?
此外,爲什麼不能倒數第二的代碼工作 - 它只是說明語法錯誤!
我試着縮進所有其他語句,但也導致語法錯誤!
請幫忙! :)
另請參閱http://stackoverflow.com/q/15112125/3001761 – jonrsharpe 2014-10-11 20:26:00