0% found this document useful (0 votes)
4 views

Module 1_QB

The document is a question bank for the course 'Introduction to Python Programming and its Applications' for the academic year 2024-2025 at the Bangalore Institute of Technology. It includes a series of questions and lab programs related to Python programming concepts, such as data types, control structures, exception handling, and user-defined functions. The questions aim to assess students' understanding and application of Python programming through practical examples and coding tasks.

Uploaded by

prodbythre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Module 1_QB

The document is a question bank for the course 'Introduction to Python Programming and its Applications' for the academic year 2024-2025 at the Bangalore Institute of Technology. It includes a series of questions and lab programs related to Python programming concepts, such as data types, control structures, exception handling, and user-defined functions. The questions aim to assess students' understanding and application of Python programming through practical examples and coding tasks.

Uploaded by

prodbythre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

BANGALORE INSTITUTE OF TECHNOLOGY

An Autonomous Institution Under VTU


K R ROAD, V V PURA, BENGALURU-04

MODULE WISE QUESTION BANK

Course Title: Introduction to Python Course Code: BPLCK205B


Programming and it’s
Applications.

Semester: II Academic Year: 2024-2025


Batch: 2024-2028

MODULE 1

1. Demonstrate with example print(), input() and string replication function.


2. Explain if, elif, for, while, break and continue statements in Python with
examples and flowchart for each.
3. Write a Python program to check whether a given number is even or odd
4. Demonstrate the concept of exception. Implement a code which prompts user
for Celsius temperature, convert the temperature to Fahrenheit, and print out the
converted temperature by handling the exception.
5. List the rules to declare a variable in Python. Demonstrate at least three different
types of variable uses with an example program.
6. Write a Python Program to find the best of two test average marks out of three
test’s marks accepted from user.
7. Predict the output and justify the answer:

(i) 11%9 (ii) 7.7//7 (iii) (200-70)*10/5 (iv) not “False” (v) 5*1**2 (vi) 10/3

8. Demonstrate the use of break and continue Keywords in looping structures


using a code snippet.
9. Explain the math operators in Python from highest to lowest Precedence with an
example for each. Write the steps how Python evaluates the given expression (5
- 1) * ((7 + 1) / (3 - 1)) and reduces it to a single value.

1
Introduction to python programming

10. Explain Local and Global Scope in Python programs. What are local and global
variables? How can you force a variable in a function to refer to the global
variable?
11. What are Comparison and Boolean operators? List all the Comparison and
Boolean operators in Python and explain the use of these operators with suitable
examples.
12. Define a Python function with syntax, and write a program to generate first N
Fibonacci numbers. The first two Fibonacci numbers are 0 and 1 and the
Fibonacci sequence is defined as a function F as Fn = Fn-1 + Fn-2. Write a
Python program which accepts a value for N (where N >0) as input and pass this
value to the function. Display suitable error message if the condition for input
value is not followed.
13. What is Exception Handling? How are exceptions handled in Python? Write a
Python program with exception handling code to solve divide-by-zero error
situation.
14. Explain the different ways to import module in python in detail with an example.
15. What are user defined functions? How can we pass parameters in user defined
functions? Explain with suitable examples.
16. Explain the Return and None value in Python with examples.

LAB PROGRAMS RELATED TO MODULE 1

1a. Develop a program to read the student details like Name, USN, and Marks in
three subjects. Display the student details, total marks and percentage with suitable
messages.

1b. Develop a program to read the name and year of birth of a person. Display
whether the person is a senior citizen or not.

You might also like