Module 1_QB
Module 1_QB
MODULE 1
(i) 11%9 (ii) 7.7//7 (iii) (200-70)*10/5 (iv) not “False” (v) 5*1**2 (vi) 10/3
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.
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.