Important Questions python
Important Questions python
Module 1
1) Demonstrate with example print(), input(), len(), format() and string concatenation and
replication
2) How to handle exceptions in python Explain with an example
3) Illustrate the use of break and continue with example
4) What are functions in python and how they are defined and used to modularize code?
5) Explain the local scope and global scope with local and global variables
6) Explain conditional branching statements with syntax. Write a suitable program for the same
7) What are user defined function? How can we pass the arguments to the functions? Explain
with suitable example
8) What are Comparison and Boolean operators? List all the Comparison and Boolean operators
9) List and explain with syntax and example the flow control statements in python
Programs
10)Write a python program to check whether the number is even or odd
11)Write a python program to print even numbers using step size in range()
12)Write a python program to check whether the given number is positive, negative or zero
13)Write a python program to generate Fibonacci sequence of length (N). Read N from console.
14)Write a python program to check whether the given number is Armstrong or not
15)Write a python program to guess the secret number between 1 to 25 within 5 guess if the
number is same then it is right guess else wrong guess
16)Develop a python program to read the name and year of birth of a person. Display whether s
person is senior citizen or not
Module 2
1) Explain the list methods with example or (Explain any 4 built in method available for
working with lists)
2) Explain in and not in operators used in list with an example
3) Show that lists are mutable
4) Explain random.choice and random.shuffle functions with list
5) Differentiate between lists and dictionary
6) What are lists in python and how they are used to store and manipulate collection of data
7) Explain with example key(), values() and items() method
8) Explain the concept of list slicing and list traversing with example
9) How is tuple different from list?
Programs
10)Write a python program to create a dictionary of 10 key value pairs and print only key on the
screen
11)Write a program to count the frequency of characters using module PPrint
12)Read N number from console and create a list. Develop a program to print the mean of the
numbers
13)Write a program to add elements into dictionary using while loop
14)What is dictionary? Write a python program to count occurrences of characters in a string and
print the count
15)Write a python program that find the missing number from the given list n-1 ranging from 1
to n .There are no duplicates(Eg: 1246378 output:5)