In the code, the input function is first used to allow the user to input an integer, and then converts it into an integer and assigns it to variable a. Then use the print function to output the result of a+1.
First input 5 from the keyboard, which means assigning the value 5 to variable a, and then input 6, which means assigning the value 6 to variable b. Determine whether a is greater than b. If it is true, output a. If it is not true, output b.
Reserved words (words that have been given specific meanings by the Python language system itself) cannot be used. Python’s reserved words are shown in the table below.
)}===The program first reads the input date, and then uses Python's datetime library to convert it into the English abbreviation of the week. Finally, use the center method of the string to center the abbreviation and decorate it with two equal signs.
The answer process is as shown in the figure: When Python is executed, the source code in the .py file will first be compiled into Python bytecode (bytecode), and then the PythonVirtualMachine (Python virtual machine) will Execute these compiled bytecodes.
arr=[1, 2, 3]arr.reverse()print(arr) where 123 can be changed to any number, for example: use modulo operation. For example: enter 234.