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

Question Bank OF Python

The document is a comprehensive question bank for Python programming, covering various topics such as installation, key features, programming modes, operators, data structures, and specific programming tasks. It includes both theoretical questions and practical programming exercises, ranging from basic syntax to more complex operations involving lists, tuples, sets, and dictionaries. The questions are designed to assess knowledge and skills in Python programming.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Question Bank OF Python

The document is a comprehensive question bank for Python programming, covering various topics such as installation, key features, programming modes, operators, data structures, and specific programming tasks. It includes both theoretical questions and practical programming exercises, ranging from basic syntax to more complex operations involving lists, tuples, sets, and dictionaries. The questions are designed to assess knowledge and skills in Python programming.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Question Bank OF Python

1) Write steps for installing Python on window.


2) State IDLE in Python.
3) List key features of Python
4) Explain Python Path
5) State use of pep and pip
6) Print the version of Python
7) Write steps to be followed to load Python interpreter in windows.
8) List different modes of Programming in Python
9) Describe procedure to execute program using Interactive Mode
10) State the steps involved in executing the program using Script Mode
11) State the procedure to make file executable
12) Write a Python program to display your name using Interactive Mode
13) Write a Python program to display “MSBTE” using Script Mode
14) Mention the use of //, **, % operator in Python
15) Describe ternary operator in Python
16) Describe about different Logical operators in Python with appropriate examples.
17) Describe about different Arithmetic operators in Python with appropriate
examples.
18) Describe about different Bitwise operators in Python with appropriate examples.
19) Write a program to convert U.S. dollars to Indian rupees.
20) Write a program to convert bits to Megabytes, Gigabytes and Terabytes
21) Write a program to find the square root of a number
22) Write a program to find the area of Rectangle
23) Write a program to calculate area and perimeter of the square
24) Write a program to calculate surface volume and area of a cylinder.
25) Write a program to swap the value of two variables
26) List operators used in if conditional statement
27) Differentiate between if-else and nested-if statement
28) Write a program to check whether a number is even or odd
29) Write a program to find out absolute value of an input number
30) Write a program to check the largest number among the three numbers
31) Write a program to check if the input year is a leap year of not
32) Write a program to check if a Number is Positive, Negative or Zero
33) Write a program that takes the marks of 5 subjects and displays the grade.
34) What would be the output from the following Python code segment?
x=10
while x>5:
print x,
x-=1
35) Change the following Python code from using a while loop to for loop:
x=1
while x<10:
print x,
x+=1
36) Print the following patterns using loop:
a. *
**
***
****
b. *
***
*****
***
*
c. 1010101
10101
101
1
37) Write a Python program to print all even numbers between 1 to 100 using while
loop.
38) Write a Python program to find the sum of first 10 natural numbers using for loop.
39) Write a Python program to print Fibonacci series.
40) Write a Python program to calculate factorial of a number
41) Write a Python Program to Reverse a Given Number
42) Write a Python program takes in a number and finds the sum of digits in a
number.
43) Write a Python
44) When to used list
45) Describe various list functions.
46) Write syntax for a method to sort a list
47) Write syntax for a method to count occurrences of a list item in Python
48) How to concatenate list
49) Justify the statement “Lists are mutable”
50) Describe the use pop operator in list
51) Write a Python program to sum all the items in a list.
52) Write a Python program to multiplies all the items in a list.
53) Write a Python program to get the largest number from a list.
54) Write a Python program to get the smallest number from a list.
55) Write a Python program to reverse a list.
56) Write a Python program to find common items from two lists.
57) Write a Python program to select the even items of a list.
58) Define empty tuple. Write syntax to create empty tuple.
59) Write syntax to copy specific elements existing tuple into new tuple.
60) Compare tuple with list (Any 4 points)
61) Create a tuple and find the minimum and maximum number from it.
62) Write a Python program to find the repeated items of a tuple.
63) Print the number in words for Example: 1234 => One Two Three Four
64) Describe the various set operations
65) Describe the various methods of set
66) Write a Python program to create a set, add member(s) in a set and remove one
67) item from set.
68) Write a Python program to perform following operations on set: intersection of
69) sets, union of sets, set difference, symmetric difference, clear a set.
70) Write a Python program to find maximum and the minimum value in a set.
71) Write a Python program to find the length of a set.
72) What is the output of the following program?
dictionary = {'MSBTE' : 'Maharashtra State Board of Technical Education',
'CO' : 'Computer Engineering',
'SEM' : 'Sixth'
}
del dictionary['CO'];
for key, values in dictionary.items():
print(key)
dictionary.clear();
for key, values in dictionary.items():
print(key)
del dictionary;
for key, values in dictionary.items():
print(key)
73) What is the output of the following program?
dictionary1 = {'Google' : 1,
'Facebook' : 2,
'Microsoft' : 3
}
dictionary2 = {'GFG' : 1,
'Microsoft' : 2,
'Youtube' : 3
}
dictionary1.update(dictionary2);
for key, values in dictionary1.items():
print(key, values)
74) What is the output of the following program?
temp = dict()
temp['key1'] = {'key1' : 44, 'key2' : 566}
temp['key2'] = [1, 2, 3, 4]
for (key, values) in temp.items():
print(values, end = "")
76)Write a Python script to sort (ascending and descending) a dictionary by value.
77)Write a Python script to concatenate following dictionaries to create a new one.
a. Sample Dictionary:
b. dic1 = {1:10, 2:20}
c. dic2 = {3:30, 4:40}
d. dic3 = {5:50,6:60}
78) Write a Python program to combine two dictionary adding values for common
keys.
a. d1 = {'a': 100, 'b': 200, 'c':300}
b. d2 = {'a': 300, 'b': 200, 'd':400}
79). Write a Python program to print all unique values in a dictionary.
a. Sample Data: [{"V":"S001"}, {"V": "S002"}, {"VI": "S001"}, {"VI": "S005"},
{"VII":"S005"}, {"V":"S009"}, {"VIII":"S007"}]
80) Write a Python program to find the highest 3 values in a dictionary.

You might also like