分享

输入输出--python

 融水公子 2018-09-11
输出
>>> 'Hello, %s' % 'world'
'Hello, world'
>>> 'Hi, %s, you have $%d.' % ('Michael', 1000000)
'Hi, Michael, you have $1000000.'

#!/usr/bin/python
# -*- coding: UTF-8 -*-
print('hello, world')
print('The quick brown fox', 'jumps over', 'the lazy dog')
print(300)
print(100 + 200)
print('100 + 200 =', 100 + 200)

hello, world
('The quick brown fox', 'jumps over', 'the lazy dog')
300
300
('100 + 200 =', 300)

输入
#!/usr/bin/python
# -*- coding: UTF-8 -*-
name = input('please enter your name: ')
print('hello,', name)

>>> name = input('please enter your name: ')
please enter your name: rongshui
>>> print('hello,', name)
hello, rongshui
>>>  
分享知识,分享快乐!希望中国站在编程之巅!

               ----

公众微信号:rsgz520

360图书馆馆号:rsgz002.360doc.com

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多