輸出
>>> '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
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請
點擊舉報。