输出 >>> '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 >>> ![]() 分享知识,分享快乐!希望中国站在编程之巅!
|
|