-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprint_parameter.py
More file actions
29 lines (28 loc) · 867 Bytes
/
print_parameter.py
File metadata and controls
29 lines (28 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#print_Parameter.py
"""
learn the Parameter of print function
object: sth you wanna to print
end : after print function is finished, then print the value of Parameter end. Default '\n'.
sep : after print every object, then print the value of Parameter sep. Default, ' '.
file : an object with a write method. Default is sys.stdout.
flush : A Boolean, specifying if the output is flushed (True) or buffered (False). Default is False.
"""
import sys
str1="handsome"
str2="and"
str3="beautiful"
print("Let's print sth")
print("the flush is false by default")
print(str1,str2,str3)
print("2th")
print(str1,str2,str3,sep="---")
print("3th")
print(str1,str2,str3,end="---")
print("4th")
print(str1,str2,str3,file=sys.stdout)
print("5th")
print(str1,str2,str3,flush="false")
print("6th")
print(str1,str2,str3,flush="true")
print("")
print()