有沒有在if語句中使用原始輸入的方法?我想問用戶一個問題,如果他們鍵入「是」,我想要編碼在if語句後繼續工作。如果他們輸入「否」,我希望代碼說「謝謝你的時間」,然後停止在特定if語句之後的所有操作。這可能嗎? 代碼(我從來沒有這樣做過,所以這是一個狂野的猜想): tri=raw_input("Do the points that you entered form a triangle? (yes
我想製作一個類似密碼程序的程序。 當用戶輸入的單詞與我給予該程序的單詞相同時,應打印出「完成」,否則「錯誤」。 x = raw_input("Enter Your name:")
y = raw_input("Enter Your L name:")
if x=Sajad and y=Ha:
print "Done"
else:
print "Wrong"
Pytho
import random
count=0
other=0
inp=raw_input('Enter number of #s: ')
bottom=raw_input('Enter min: ')
upper=raw_input('Enter max: ')
middle=raw_input('Provide middle number')
for x in range(int(i
我有以下代碼: print "We're going to write to a file you'll be prompted for"
targetfile = raw_input('Enter a filename: ')
targetfilefound = open('targetfile' , 'w')
print "What do we write in this file?"
我想遞歸地寫這個來用ord和chr編碼字符串中的其他字母,但是當我遞歸地編寫它時,它會再次調用用戶的raw_input。我該如何解決? def rawEncode(input):
input= raw_input("GIVE ME SUPER SECRET MESSAGE TO ENCODE")
unencoded="%s" %input [:]
if "%s" %i