欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程语言 > python >内容正文

python

python控制结构实训_Python 控制结构

发布时间:2023/12/20 python 37 豆豆
生活随笔 收集整理的这篇文章主要介绍了 python控制结构实训_Python 控制结构 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

坚持代码练习,上次的作业你做了吗?

这是参考答案:

继续练习,本次测验题目如下:

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接受逗号分隔的数字序列, 然后产生一个列表和一个数组,他们都分别包含这些数字。假如,给定这些数字,5,15,21,9,10,99;

好,开始我们今天的正题,Python的控制语句:

Python provides conditional branching with if statements and

创作挑战赛新人创作奖励来咯,坚持创作打卡瓜分现金大奖

总结

以上是生活随笔为你收集整理的python控制结构实训_Python 控制结构的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。