美文网首页python
2.Python_0: Hello!

2.Python_0: Hello!

作者: MissLady的学习志 | 来源:发表于2020-07-14 19:48 被阅读0次

****学 习 地 址 :****

计算机科学圈| 01000011 01010011 01000011

https://cscircles.cemc.uwaterloo.ca/


1. 输出函数print( )

  • Built-in Functions

  • print 是一个Python指令,它的作用是将信息发给输出。

  • print( ), 括号( ) 内是要输出的内容

语法(Syntax):

print(object(s), sep=separator, end=end, file=file, flush=flush)

参数(Parameter Values):

Parameter Description
object(s) Any object, and as many as you like. Will be converted to string before printed
sep='separator ' Optional. Specify how to separate the objects, if there is more than one. Default is ' '
end='end ' Optional. Specify what to print at the end. Default is '\n' (line feed)
file Optional. An object with a write method. Default is sys.stdout
flush Optional. A Boolean, specifying if the output is flushed (True) or buffered (False). Default is False

object(s) -- 表示输出的对象。输出多个对象时,需要用 , (逗号)分隔。

sep='separator ' -- 可选,用来间隔多个对象,默认' '。

end='end '-- 可选,用来设定以什么结尾,默认值是换行符 \n。

file -- 可选,要写入的文件对象,默认sys.stdout。

flush-- 可选,布尔值,指定输出是刷新(真)还是缓冲(假),默认缓冲。

2. Coding Exercise & Answer

写一个程序,打印出:Bonjour, tout le monde!

参考:

[1] https://cscircles.cemc.uwaterloo.ca/

[2] https://www.w3schools.com/python/ref_func_print.asp

相关文章

  • 2.Python_0: Hello!

    ****学 习 地 址 :**** 计算机科学圈| 01000011 01010011 01000011https...

  • EIGRP

    hello hello hello hello hello hello hello hello hello hel...

  • hello

    hello hello hello hello hello hello

  • Hello hello

    Hello, hello, How are you I'm fine and hello to you.Go...

  • Hello hello

  • hello hello

    you areguokun@cbice.com you areguokun@cbice.com you aregu...

  • Hello

    Hello,hello,hello,how are you? Hello,hello,hello,how are ...

  • Markdown

    Hello Hello Hello Hello Hello Hello ba dd hi liHelloHello...

  • 2018-12-14

    hello Hello Hello Hello

  • Hello world!

    hello world! hello hello hello

网友评论

    本文标题:2.Python_0: Hello!

    本文链接:https://www.haomeiwen.com/subject/cdafhktx.html