僞代碼如何創建用戶輸入一個Python列表,然後輸出列表細節
def main():
create an empty list
value = getInput()
while value isnt zero:
add value to the list
value = getInput()
printOutput(list)
def getInput():
prompt the user for a value
make sure that the value is an int (convert to int)
return the number
def printOutput(list):
print out the number of input values
print out the individual input values
print out the sum of the input values
既然你已經能夠制定已經僞代碼,什麼是你真正遇到問題了嗎? – Dolda2000
究竟Dolda2000, –
對不起,這是賦值說明中給出的內容。我試圖翻譯成python代碼,但它返回錯誤。 – user3315421