题解 | #读入整数数字#
读入整数数字
https://www.nowcoder.com/practice/a82efa7714e9466b9f9e1020b4da2b45
import sys num = int(input()) num_type = type(num) print(num) print(num_type)
- 使用int函数将从键盘录入的内容强制转换成整数
- 使用type函数查看变量类型,并将变量类型命名为num_type
读入整数数字
https://www.nowcoder.com/practice/a82efa7714e9466b9f9e1020b4da2b45
import sys num = int(input()) num_type = type(num) print(num) print(num_type)
相关推荐