python3 基础语法:基本输入输出

输出

使用print可以直接输出任意类型数据:

print("hello")
print(123)
print(123,46)
print(1+2+3)
  • 需要输出空格时,使用逗号分开。

输入

输入使用input函数,输入的内容形式为字符串:

print("please input a name")
name = input()
print(type(name))  #<class 'str'>
print(name)

 

posted @ 2018-11-15 15:50  刘-皇叔  阅读(436)  评论(0编辑  收藏  举报