Question
use python IDEL
Please highlight the answer
1 ווCIוסטIT Errors and Exceptions. There are two main types of errors: syntax errors and runtime errors. Syntax errors are de
Question 1 0.5 pts >>> x, y = 10,0 >>> Z = x/y record the error(only the last line of error message) Question 2 0.5 pts # con
Question 3 0.5 pts #continue the code snippet above >>> Z = x + y + a record the error(only the last line of the error messag
Question 5 0.5 pts # continue the code snippet above >>> a = A >>>try: z = x+y+a except NameError: print(Some variables ar
Question 6 0.5 pts # continue the code snippet above >>>try: Z= x+y+a except NameError: print(Some variables are not defined
Question 7 0.5 pts >>> num = int (input (Enter an integer: )) Enter an integer: enter a record the error(only the last li

Question 9 3 pts Write a code snippet Write a code snippet of a function get_data () that asks the user to enter a float numb
Question 10 0.5 pts #continue the code snippet above >>>get_data enter 10 record the answer Question 11 0.5 pts # continue th
Write a code snippet Modify your function get_data() that allows the user to enter a value multiple times until a value is of
Question 13 1 pts Based on your code above: >>>get_data() enter abc output 1 = enter $2.0 output 2 = enter 5.95 output 3 =
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1) Zero division error

because x=10 and y =0 ; so 10/0 gives an zero division error

==================================

2) Division by zero is prohibitted

first it will run through the z=x/y and finds an zero error since except statement is used so it will print the thing in except statement

=======================================

3)Name Error

here a is not defined so it will return a name error (invalid identifier)

======================================

4)Some variables are not defined.

In try statement it gor name error so the loop will return to the except statement and prints "Some variables are not defined

Add a comment
Know the answer?
Add Answer to:
use python IDEL Please highlight the answer 1 ווCIוסטIT Errors and Exceptions. There are two main...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • use python IDEL Please highlight the answer Problem 1 Errors and Exceptions. There are two main...

    use python IDEL Please highlight the answer Problem 1 Errors and Exceptions. There are two main types of errors: syntax errors and runtime errors. Syntax errors are detected by the Python interpreter before the program execution during the parsing stage (parsing is a process, during which the Python interpreter analyzes the grammatical structure of the program). Runtime errors are errors in a program that are not detected by the Python interpreter during its parsing stage. They are further divided into...

  • use python IDEL Please highlight the answer Problem 2 Files. Since almost all data can be...

    use python IDEL Please highlight the answer Problem 2 Files. Since almost all data can be stored in files, knowing how to use files in programs is invaluable. Today you will practice with opening a file for reading, writing and editing using the Python interpreter. Do not type messages in red into Python shell Question 14 0.5 pts create a new file mytext.txt for >>>f1 = open("mytest.txt","w+") writing & reading >>>f1.write("hello\n") >>>for i in range(5): f1.write(str(i) + "\n") >>>f1.readlines() record...

  • (Python) Exercise-1: Raising Exceptions Try the following code one by one: raise NameError(‘Name not Found’) raise...

    (Python) Exercise-1: Raising Exceptions Try the following code one by one: raise NameError(‘Name not Found’) raise IndexError("Sorry, index not found!") raise KeyError("Sorry, my fault!") What it does? Exercise-2: Raising Exceptions Try the following code: try : raise NameError( 'Name not found' ) except NameError: print ( 'caught it' ) What it does? Exercise-3: Raising Exceptions using class Here is an example related to RuntimeError. Here, a class is created that is a sub-class from RuntimeError. This is useful when you...

  • 12p I need help this is Python EXCEPTIONS: It's easier to ask forgiveness than permission. Try...

    12p I need help this is Python EXCEPTIONS: It's easier to ask forgiveness than permission. Try the code and catch the errors. The other paradigm is 'Look before you leap' which means test conditions to avoid errors. This can cause race conditions. 1.Write the output of the code here: class MyError(Exception): pass def notZero(num): if num == 0: raise MyError def run(f): try: exec(f) except TypeError: print("Wrong type, Programmer error") except ValueError: print("We value only integers.") except Zero Division Error:...

  • use python IDEL Please highlight the answer Problem 3 Files. Read the following code and answer...

    use python IDEL Please highlight the answer Problem 3 Files. Read the following code and answer the next five questions about it. The contents of the files list 1.txt and list2.txt are the following (given side by side): list 1. txt content: list2.txt content 2 apples 2 apples 3 oranges 1 loaf of bread 2 eggs 2 eggs 1 cereal box # the program code starts here filename1 = "list 1.txt" filename2 - "list2.txt" filename3 - "listdiff.txt" with open (filename1,"r")...

  • use python IDEL Please highlight the answer Problem 1 Lists. Read the following code and answer...

    use python IDEL Please highlight the answer Problem 1 Lists. Read the following code and answer the next five questions about it. X = ? y=? z = ? zodiac = ["cow", "tiger", "rabbit", "dragon", "snake", "horse" "sheep", "monkey", "dog", "chicken", "pig", "rat"] first_group = zodiac[0:x] second_group = zodiac[x:y] third_group - zodiac[y:z] animals = [] for item in first_group: animals.append(item) for item in third_group: animals.append(item) for item in second group: animals.append(item) #first print statement print (animals) i = ? j...

  • use python IDEL Please highlight the answer Problem 2 Dictionary. Read the following code and answer...

    use python IDEL Please highlight the answer Problem 2 Dictionary. Read the following code and answer the next five questions about it. book1 = ("Alice":"arts", "Bob": "botany" "Clara": "chemistry", "Dasha": "digital media") book2 = {"Eve": "electronics", "Forest": "finances". "George": "geology", "Harry": "history". "Ivan": "Italian", "Joanna": "Japanese Arts") mybook=0 condition 1 = ? condition2 - ? condition3 = ? for key in book 1.keys(): mybook[key] =book 1.get(key) mybook.update(book 2) #first print statement print (mybook) if condition 1: mybook["Bob"] = "biochemistry" mybook["Eve"]...

  • Greeting! Kindly help me to solve my finals in PYTHON, I don't have a knowledge in...

    Greeting! Kindly help me to solve my finals in PYTHON, I don't have a knowledge in PYTHON, new student. Please, please, I'm begging, Kindly answers all the questions. I'm hoping to grant my request. Thanks in advanced. 1.) What is the output of the following snippet? l1 = [1,2] for v in range(2): l1.insert(-1,l1[v]) print(l1)        a.) [1, 2, 2, 2]        b.) [1, 1, 1, 2]        c.) [1, 2, 1, 2]        d.) [1,...

  • QUESTION 1 What is the output of the following code snippet? int main() { bool attendance...

    QUESTION 1 What is the output of the following code snippet? int main() { bool attendance = false; string str = "Unknown"; attendance = !(attendance); if (!attendance) { str = "False"; } if (attendance) { attendance = false; } if (attendance) { str = "True"; } else { str = "Maybe"; } cout << str << endl; return 0; } False True Unknown Maybe QUESTION 2 What is the output of the following code snippet? #include <iostream> #include <string> using...

  • Using python 3.6 How do I incorporate 0 or negative input to raise an error and...

    Using python 3.6 How do I incorporate 0 or negative input to raise an error and let the user try again? like <=0 #loop to check valid input option. while True: try: choice = int(input('Enter choice: ')) if choice>len(header): print("Invalid choice!! Please try again and select value either:",end=" ") for i in range(1,len(header)+1): print(i,end=",") else: break choice = int(input('\nEnter choice: ')) except ValueError as ve:print('Invalid response, You need to select the number choice from the option menu') # Catch your...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT