Tag: arithmetic operation print text. COM log hint information type input img
Summarize the most basic input and output and operators today
Input:
Python3 is all input ("")
Input ()
name = input () #输入的值会直接赋值给name
Name = input ("Please enter your name:") # ("") in the words to enter the prompt message
Ps:
The value you enter is assigned directly to name.
Input value is str type if you want to enter a value of a numeric type, you can: name = Int (input ()) Other types of input methods are identical.
Output:
Output the name value just now. (with text hint)
1. Print ("Name:", name)
2. Print ("Name:%s"%name) #% represents the placeholder s that is the character corresponding to the% following
A second way is recommended because you can control where the print is located.
Ps:
Operator:
Arithmetic operators:
Define two variables A = ten B = 20
Assignment operators:
Comparison operators:
Logical operators:
Python Basics (3): Input output and operators