tags: python
A we call it a variable
A = 'Hello, the world'
print(a)
Data in Python has their own data types
print(4) int Integer type
print(3.1415) floattype
print((-1) ** 0.5) complextype
String in Python requires a pair of single quotes, or double quotes to package
print('Today's weather is fine, good scenery is good at)
print('56')
There are only two values in the Boolean type, one is True, one is false
print(4 > 3) True
print(1 > 5) False
names = ['Song Jiang',' ','Wu Song',' ']
person = {'Name':'Dalang','Profession':Buy Cake ','height':'150'}
nums = (1,5,6,9,8)
x = {9,'hello','good',True}
a = 34
b = 'hello'
c = True
d = ['Jay Chou','Eason Chan','Zhang Yu']
print(type(c))
In Python, the variable is no data type, the data type of our variable is actually the data type of the value corresponding to the variable.
Nameout of the identifier:
rule:
1. Composed of numbers, letters, and underline, can not start with numbers
2. Strictly case sensitive (in computer programming, a total of 52 letters)
3. Cannot use keywords
Keywords: In Python language, there is a special meaning word, such as IF, For, Else, While, Try, etc.,
** Specification: ** Suggested compliance, compliance with the specification is professional, and the code is easy to read.
1. Small hump naming method: The first letter of the first word is lowercase, the first letter of each word is capitalized in UserNameAndPassword
2. Big hunch nomenclature: the first letter of each word is capitalized in Personmodel
3. Use the underscore connection: user_name_and_password
Use the variable, function and module name in Python, using underscore: Python's class name uses a large peak nomenclature
Assignment statement
a = 23
I = 'Peng Yuxi'
print(I)
Chapter two This chapter overview Introducing the reserved word, identifier, variable, basic data type, data type conversion, operator, expression, and other content in Python 2.1 Python Grammatical F...
Reserved words: 'False', 'None', 'True', '__peg_parser__', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'glo...
type of data String: STR Value: int / float Bur: True / False List: List Metropolitan group: TUPLE Collection: set Dictionary: DICT The above program running results Identifier Simply put, a string of...
Reserved wordThat is, some words that have been given a special meaning by the Python language, and cannot be used as an identifier. Identifier:includeVariables, functions, classes, modules, and other...
The naming of the identifier is clear, clear, clear meaning, and use a complete word or abbreviations that you can understand, avoid misunderstanding. Note: The shorter words can be abbreviated by rem...
Floating point number 1. Origin of the name: The floating point number is a decimal number. According to the scientific counting method, the decimal point position is variable, so it is called a float...
A thousand miles begins with a single step. Python is an interpreted language, the language is object-oriented. Identifier: 1.C language, JAVA has an identifier, and there are differences python 2.PYT...
Python foundation - identifier Identifier Identifier specification variable name Outward Identifier The identifier is our own name, namely the name of the name. Identifier specification Composed of al...
JVM Java virtual machine, referred to as JVM, is a hypothetical computer to run all Java programs, a Java program is one of the operating environment, but also one of the most attractive characteristi...
1 , keyword:...