• 技术文章 >常见问题 >Python常见问题

    python的交互模式怎么输出名文汉字

    silencementsilencement2019-11-12 11:50:12原创2672

    Python交互模式

    在命令行模式下敲命令python,就看到类似如下的一堆文本输出,然后就进入到Python交互模式,它的提示符是>>>,

    在Python交互模式下输入exit()并回车,就退出了Python交互模式,并回到命令行模式:

    1

    2

    3

    4

    5

    6

    7

    8

    C:\Users\Administrator>python

    Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32

    Type "help", "copyright", "credits" or "license" for more information.

    >>> 300 + 200

    500

    >>> exit()

     

    C:\Users\Administrator>

    了解了交互模式,那么在交互模式下输出文本,文字等内容,就简单了,如下

    1

    2

    3

    4

    5

    6

    7

    8

    C:\Users\Administrator>python

    Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32

    Type "help", "copyright", "credits" or "license" for more information.

    >>> print('我爱你中国')

    我爱你中国

    >>> print('祖国万岁')

    祖国万岁

    >>>

    可以看到,我们主要使用的是print函数。python学习网,免费的python学习网站,欢迎在线学习!

    专题推荐:交互模式
    上一篇:python如何计算乘法 下一篇:python的内建函数在哪里

    相关文章推荐

    • python交互模式是什么• 对Python的交互模式和直接运行.py文件的区别详解• python 交互模式怎么切换目录

    全部评论我要评论

    © 2021 Python学习网 苏ICP备2021003149号-1

  • 取消发布评论
  • 

    Python学习网