In Python, functions return 'None' by default, and user input can be taken until a dot is entered. Successful execution is indicated by Exit Code 0, while Exit Code 1 signifies a crash. Programmers should anticipate exceptions like 'ValueError' for non-numerical inputs and 'ZeroDivisionError' for division by zero, handling them with appropriate error messages.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
2 views2 pages
Python Notes
In Python, functions return 'None' by default, and user input can be taken until a dot is entered. Successful execution is indicated by Exit Code 0, while Exit Code 1 signifies a crash. Programmers should anticipate exceptions like 'ValueError' for non-numerical inputs and 'ZeroDivisionError' for division by zero, handling them with appropriate error messages.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
Python Notes:
By default, functions in python return “None” value.
This part of code to take from user multiple lines as an input:
//When the user enter a dot it's stop the input
Exceptions:
Exit Code: 0 -> means that the program executed successfully.
Exit Code: 1 -> means that the program crashed. “The good programmer must anticipate this situations ” then, you should handle the situation and print a proper error message.
There are different kinds of exceptions:
“ValueError” : “ex. If you entered a non-numerical value in integer
variable”. “ZeroDivisionError” : if you divide a number over zero