打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
2. 输入输出
1. print()
输出到控制台
可打印字符串,数字以及变量值
print(12)
print("like")
print(x)
print(1,2,3)

2. print() 的格式化输出
print(format(12.12345, '6.2f'))
输出结果: 12.12

print(format(0.12345, '6.1%'))
输出结果: 12.3%

3. re = input(prompt)
re:返回值
prompt:提示字符

str = input("Please input a string:")
num = int(input("Please input a number:"))
float1 = float(input("Please input a float:"))
type(str):str
type(num):int
type(float1):floag

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
python的输出——print的不同形式总结
第0~3关笔记
《Python程序设计》第5章 面向对象设计和异常处理
基础语法第2关笔记
MFC中CString的Format方法使用技巧
Python语言程序设计基础(第二版)嵩天等课后习题答案
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服