1. print () and input (), 1. printinput
Hello world (required)-print function
Print (): function:
Print function, print data to the screen
Parameter List:
print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
Parameter description:
Value,..., indicates that there can be multiple data to be printed, such as print ("a", "B", "c ")
Sep indicates the parameters between the printed data.
"End" indicates the end character to be printed. For example, "\ n" indicates that the line break is printed, and "\ t" indicates that the line break is indented to the next position.
File indicates the output stream, sys. stdout indicates the standard output stream, and sys. stderr indicates the standard error stream.
Flush indicates whether to refresh the buffer immediately
Usage:
print("hello world!")print(1,2,3,sep='\t')print('a','b','c',sep='#')print(1,end='\t')print(2)
Output result:
hello world!1 2 3a#b#c1 2
Input (): function:
Input Function to obtain user input
Parameter List:
Input ("input prompt information ")
Usage:
Name = input ("Your name:") age = input ("your age :")
Output result:
To use the non-plaintext mode, use getpass in the getpass module:
(This module cannot be used normally in pycharm ))
Usage:
Import getpasspwd = getpass. getpass ("enter the password :")