NOTE!
Click on MENU to Browse between Subjects...17CS664 - PYTHON APPLICATION PROGRAMMING
Answer Script for Module 1
Solved Previous Year Question Paper
CBCS SCHEME
PYTHON APPLICATION PROGRAMMING
[As per Choice Based Credit System (CBCS) scheme]
(Effective from the academic year 2017 - 2018)
SEMESTER - VI
Subject Code 17CS664
IA Marks 40
Number of Lecture Hours/Week 3
Exam Marks 60
These Questions are being framed for helping the students in the "FINAL Exams" Only
(Remember for Internals the Question Paper is set by your respective teachers).
Questions may be repeated, just to show students how VTU can frame Questions.
- ADMIN
ANSWER :
16.1 Computational Errors:
Catching Exceptions using try and except blocks
there is a chance of runtime error while doing some program. One of the possible reasons is wrong input. For example, consider the following code segment -
a=int(input("Enter a:"))
b=int(input("Enter b:"))
c=a/b
print(c)
When you run the above code, one of the possible situations would be -
Enter a:12
Enter b:0
Traceback (most recent call last):
File " E:/BE CS/CSE/17-Scheme/6th Sem/OPEN_ELECTIVE/17CS664_PAP/SOLVED_QB/program/mod 2 py code/16.1_div_by_0.py", line 154, in <module>
c=a/b
ZeroDivisionError: division by zero
For the end-user, such type of system-generated error messages is difficult
to handle. So the code which is prone to runtime error must be executed
conditionally within try block. The try
block contains the statements involving suspicious code and the except
block contains the possible remedy (or
instructions to user informing what went wrong and what could be the way to
get out of it). If something goes wrong with the statements inside try
block, the except
block will be executed. Otherwise, the except-block will be skipped.
Consider the example -


Handling an exception using try is called as catching
an exception. In general, catching an
exception gives the programmer to fix the probable problem, or to try again
or at least to end the program gracefully.
16.2 Program


ANSWER :
Refer 1st & 4th
Question & Answer or Click Here
ANSWER :
Refer 3rd
Question & Answer or Click Here
ANSWER :


ANSWER :
Refer 12th
Question & Answer or Click Here
Below Page NAVIGATION Links are Provided...
All the Questions on Question Bank Is SOLVED