怎样在 Python 编写input()和output()函数

 时间:2024-10-12 08:33:08

1、首先,右键点击【项目】,创建一个【Python】文件

怎样在 Python 编写input()和output()函数

2、接着,在右侧输入代码,代码写在【下一步】

怎样在 Python 编写input()和output()函数

3、然后,复制代码粘贴到文件中N = 3# stu# num : string# name : string# score[4]: liststudent = []for i in range(5): student.append(['', '', []])def input_stu(stu): for i in range(N): stu[i][0] = raw_input('input student num:\n') stu[i][1] = raw_input('input student name:\n') for j in range(3): stu[i][2].append(int(raw_input('score:\n')))def output_stu(stu): for i in range(N): print '%-6s%-10s' % (stu[i][0], stu[i][1]) for j in range(3): print '%-8d' % stu[i][2][j]if __name__ == '__main__': input_stu(student) print student output_stu(student)

怎样在 Python 编写input()和output()函数

4、随后,右键选择运行代码文件

怎样在 Python 编写input()和output()函数

5、最后,在最下面就可以看到运行结果了

怎样在 Python 编写input()和output()函数
  • 学分绩点怎么算
  • DW如何配置搜索动态相关文件为自动
  • 导数计算y=(2x+1)^2*(2x^3+2x-7)^(-1)步骤
  • 大创比赛的全名是什么
  • 互联网加比赛的团队名字大全
  • 热门搜索
    磊科路由器怎么安装 生活感悟句子 生活片网站 快活的反义词是什么 赤月峡谷怎么走 苹果官换机是什么意思 低碳生活小窍门 xp系统怎么还原 女人心情不好怎么办 如何选择空调