Objective
Python version: 3.6.2
I. INPUT and OUTPUT
1. Output:
Use print () to output the specified content.
The content in parentheses can be a string:
Print ("hello,world")
can also be a comma "," separated by a number of strings, when the comma is encountered will output a space, the following output is: Hello World
Print ("Hello","World")
It can also be used as a mathematical formula to output the calculated results:
Print (12/5)
2. Enter
Input () can receive input from the user. It is important to note that the input () function in Python3 has all the inputs treated as strings, unlike in Python2.
str = input ()
Ii. Common data types
1.Number (digital)
Python3 supports Int,float,complex (plural), there is no limit to the number size in Python3
The complex number is made up of real and imaginary parts, which can be represented by a + BJ, or complex (a, b), and the real and imaginary part of the complex number are floating point types.
A, b, C = 0.1, 4+3jprint(type (a), type (b), type (c))
<class ' int ' > <class ' float ' > <class ' Complex ' >
2.String (String)
3.Boolean
Boolean values are calculated using And,or,not
3.List (list)
List is a mutable ordered set
4.Tuple (tuple)
Tuple is immutable ordered set
5.Set (Collection)
6.Dictionary (dictionary)
Python Learning notes----python basics