python控制结构实训_Python 控制结构
堅持代碼練習(xí),上次的作業(yè)你做了嗎?
這是參考答案:
繼續(xù)練習(xí),本次測驗題目如下:
Question 4 Level 1 Question:
Write a program which accepts a sequence of comma-separated numbers from console and generate a list and a tuple which contains every number.
Suppose the following input is supplied to the program: 34,67,55,33,12,98 Then, the output should be:
[‘34’, ‘67’, ‘55’, ‘33’, ‘12’, ‘98’]
(‘34’, ‘67’, ‘55’, ‘33’, ‘12’, ‘98’)
Hints:
In case of input data being supplied to the question, it should be assumed to be a console input.
tuple() method can convert list to tuple
中文大意:編寫一個程序,能夠從console接受逗號分隔的數(shù)字序列, 然后產(chǎn)生一個列表和一個數(shù)組,他們都分別包含這些數(shù)字。假如,給定這些數(shù)字,5,15,21,9,10,99;
好,開始我們今天的正題,Python的控制語句:
Python provides conditional branching with if statements and
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎總結(jié)
以上是生活随笔為你收集整理的python控制结构实训_Python 控制结构的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql使用小技巧_MySQL使用小技
- 下一篇: python的序列化是什么意思_pyth