Future Vision BIE Future Vision BIE


ONE STOP FOR ALL STUDY MATERIALS & LAB PROGRAMS


E MENU Whatsapp Share Join Telegram, to get Instant Updates
×

NOTE!

Click on MENU to Browse between Subjects...

Advertisement

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




Advertisement

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




× CLICK ON THE QUESTIONS TO VIEW ANSWER

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 -

Loading Image

Loading Image

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

Loading Image

Loading Image



Advertisement

ANSWER :

Refer 1st & 4th Question & Answer or Click Here


ANSWER :

Refer 3rd Question & Answer or Click Here



Advertisement

ANSWER :

Loading Image

Loading Image


ANSWER :

Refer 12th Question & Answer or Click Here


× NOTE: Each Page Provides only 5 Questions & Answer
Below Page NAVIGATION Links are Provided...
All the Questions on Question Bank Is SOLVED

Advertisement

lIKE OUR CONTENT SUPPORT US BY FOLLOWING US ON INSTAGRAM : @futurevisionbie

For immediate Notification Join the Telegram Channel



× SUGGESTION: SHARE WITH ALL THE STUDENTS AND FRIENDS -ADMIN