INT(Input())和仅输入()有什么区别
我是Python的新手,当我使用Input()用于包括数字在内的任何输入时,但我的老师说的是使用INT(Input())用于基于整数的输入。有人可以解释这些语法有什么区别?
I am new to python, and when I use the input() for any inputs including numbers it works, but my teacher is saying to use int(input()) for integer-based inputs. Can someone explain what is the difference between these syntaxes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
input()
返回字符串
。要将其更改为一个数字(
Integer
)doint()
,因此它将是int(input())
。input()
returns astring
.To change it to a number(an
integer
) doint()
, so it would beint(input())
.