1.print
>>> print ' Hello World '
Syntaxerror:missing parentheses in call to ' print '
>>>
After the Python version was updated, a lot of functions were removed from the 3.X version, in 3. In the X version of Python, print needs parentheses
Such as:
>>> print (' Hello World ')
Hello World
>>>
Another: When the data is output as a group, python2.x directly after the output data need to add ",", but the use of this method in python3.x is not valid, you should use the following code:
>>> print (item, end= "")
2.input
>>> myname=raw_input (' Ener Your Name: ')
Traceback (most recent):
File "<pyshell#129>", line 1, in <module>
Myname=raw_input (' Ener Your Name: ')
Nameerror:name ' raw_input ' is not defined
>>>
Same as 1, due to version issue. Can be replaced directly with input
Such as:
>>> myname=input (' Ener Your Name: ')
Ener your Name:cookie
>>>
3.decimal
>>> Print (decimal. Decimal (' 1.1 '))
Traceback (most recent):
File "c:/users/cookie/desktop/bb.py", line 2, <module>
Print (decimal. Decimal (' 1.1 '))
Nameerror:name ' decimal ' is not defined
>>>
Error ' decimal ' not defined, import decimal package can
Such as:
>>> Import Decimal
>>> Print (decimal. Decimal (' 1.1 '))
1.1
>>>
Python3. Simple error Handling in X