- Lab 10 Remember You Will Need To Include Any File Referenced By Your Program Other Python Files Sound Or Graphic Fi 1 (48.13 KiB) Viewed 11 times
* Lab 10 Remember: You will need to include any file referenced by your program (other python files, sound or graphic fi
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
* Lab 10 Remember: You will need to include any file referenced by your program (other python files, sound or graphic fi
* Lab 10 Remember: You will need to include any file referenced by your program (other python files, sound or graphic files, etc. INSIDE the same folder with your programs. 1. Using IDLE's editor, create a program and save it as number.py that prompts the user to enter a number and then displays the type of the number entered (integer, or float). For example, if the user enters 6, the output should be int. Be sure to use try:except and try:except:finally where appropriate to implement appropriate exception handling for situations where the user enters a string that cannot be converted to a number. 2. Write a program that prompts for two numbers. Add them together and print the result. Catch the ValueError if either input value is not a number, and print a friendly error message. Test your program by entering two numbers and then by entering some text instead of a number. Save your program as addition.py