number=int(input("請輸入一個整數(shù)(1-10)" ))
if number in [1,3,5,7,9]:
print("奇數(shù)")
elif number in [2,4,6,8]:
print("偶數(shù)")
else:
print("輸入錯誤!")
![]() ![]() 學習達人
|
韓永澤Z
展開
|
![]() ![]() 學習達人
|
T897758vz
展開
|
![]() ![]() 學習達人
|
清風歸客100W
展開
userList = ['Alan']passWord_list = ['123456Mm']
operation = int(input('你好,歡迎使用xxx,注冊請輸入1,登錄請輸入2\n'))
if operation == 1:
newName = str(input('請輸入您的姓名\n'))
if newName in userList:
print('您已有賬號,請退出后選擇登錄操作')
exit()
elif newName not in userList:
userList.append(newName)
print('創(chuàng)建用戶成功')
pass |
![]() ![]() 學習達人
|
T785706so
展開
A=['小份:5','中份:6','大份:7']
B=['雞蛋:2','蔬菜:3','火腿:4']
print('菜單:\n',A,'\n',B)
dicta={'小份':5,'中份':6,'大份':7}
dictb={'雞蛋':2,'蔬菜':3,'火腿':4}
A=str(input('請選擇煎餅類型:'))
B=str(input('請選擇配料:'))
if dicta[A]+dictb[B]>=10:
print('你一共消費(元):',dicta[A]+dictb[B],'并贈送豆?jié){一杯!')
else:
print('你一共消費(元):',dicta[A]+dictb[B]) |
![]() ![]() 學習達人
|
longf77
展開
|
![]() |
wang000445
展開
|
承擔因您的行為而導致的法律責任,
本站有權(quán)保留或刪除有爭議評論。
參與本評論即表明您已經(jīng)閱讀并接受
上述條款。