码迷,mamicode.com
首页 > 编程语言 > 详细

Python2 与 Python3 区别

时间:2019-01-12 13:11:34      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:python3   print   python2   使用   bsp   hello   用法   inpu   nbsp   

Python2 中 print 用法为 print "Hello World"
Python3 中 print 用法为 print("Hello World")

Python2 中的 input() 函数:获取当前输入的内容,并将其作为数字类型来处理
Python3 中的 input() 函数:获取当前输入的内容,并将其作为字符串类型来处理

Python2 中的 raw_input() 函数用于获取当前输入的内容,并将其作为字符串类型来处理
Python3 中不再有 raw_input() 函数,使用 input() 函数来替代

 

 

 

 

 

 

 

    

Python2 与 Python3 区别

标签:python3   print   python2   使用   bsp   hello   用法   inpu   nbsp   

原文地址:https://www.cnblogs.com/pzk7788/p/10259214.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!