# # Reference input, and display text when referencing input
Name = input (' What's Your name ')
# # NAME = ' Stan '
Print (' Your name is ', name)
# #/For exact division,//for dividing, leaving only integral parts,% to take remainder
Print (' 10/3 = ', 10/3)
Print (' 10//3 = ', 10//3)
Print (' 10%3 = ', 10%3)
# # Try using Chinese
Print (' Chinese ')
# # defines and references the list array, using []
# # The input negative number in the array is the countdown start count
TSTR = [' T1 ', ' T2 ', ' T3 ']
Print (' Tstr is ', tstr)
Print (' tstr[0] = ', tstr[0], ', tstr[1]= ', tstr[1], ', tstr[2]= ', tstr[2])
Print (' tstr[-3] = ', tstr[-3], ', tstr[-2]= ', tstr[-2], ', tstr[-1]= ', tstr[-1])
# # Insert new data into the array
Tstr.insert (1, ' T_insert ')
Print (' Run Tstr.insert, Tstr is ', tstr)
# # Append Add a number to the last array
Tstr.append (' T_insert2 ')
Print (' Run tstr.append, Tstr is ', tstr)
# # POP () deletes the array data, deletes the last one when no number is lost, deletes the specified position when entering a number
Tstr.pop ()
Print (' Run Tstr.pop (), Tstr is ', tstr)
Tstr.pop (1)
Print (' Run Tstr.pop (1), Tstr is ', tstr)
Tstr.pop (-1)
Print (' Run Tstr.pop ( -1), Tstr is ', tstr)
# # Other data can also be used in arrays
TSTR2 = [' Z1 ', ' Z2 ']
Print (' Tstr2 is ', TSTR2)
Tstr.insert (1,TSTR2)
Print (' Insert tstr2, Tstr is ', tstr)
Tstr2.insert (2, ' Z3 ')
Print (' After TSTR2 changed, Tstr2 is ', TSTR2)
Print (' After TSTR2 changed, Tstr is ', tstr)
# # defines and references a tuple array, uses (), cannot be modified after a tuple definition, 1 elements must be defined with a comma ', ' to disambiguate
# # Although the tuple is immutable, the tuple value also changes when the list,list change can be quoted
STU1 = (1,2,TSTR2)
STU2 = (1,)
Print (' stu1 is ', STU1)
Print (' stu1[0] is ', stu1[0], ' stu1[1 "is ', stu1[1])
Print (' Stu2 is ', STU2)
Print (' stu2[0] is ', stu2[0])
A test script that is readily written in the Python learning process-test1.py