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

Python Question Bank

Uploaded by

Afsana Shaikh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Python Question Bank

Uploaded by

Afsana Shaikh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Question Bank

Class-XI
Subject:- INFORMATICS PRACTICES(065) PYTHON
1.What is the importance of cache memory in a Computer System?
2.What are keywords in Python?
3.Which of the following are legitimate variable declarations:
(i) My.var (ii) _GLOBAL (iii) for (iv) While
4.What will be the output of the following program?
a, b, c = 10, 20, 30
a, b ,a = c+2, a+5, c+3
print(a, b)
5.Write a program to find simple interest using principal, rate and time.
6.What will be the output of the following Python code?
a, b = 10, 50
if b % a == 0:
print(b//4)
print(a/2)
else:
print(a**2)
print(b%3)
7.Write a Python program to find the area and perimeter of a rectangle based on user choice. (If
user types 1, area is displayed and if 2 is typed, perimeter is displayed.)
Convert the following Python program using for loop.
i = 0 sum = 0
whilei<=10:
sum = sum + i
i=i+1
print(sum)
8.Write a Python program to print the series 1 3 5 7 9 11 up to a given limit.
9.Write a Python program to find the product of numbers up to a given limit
10.Draw a flow chart to check whether a given number is odd or even.
11.Draw the decision tree to check if a person is eligible for voting (above 18 years of age).
12.Write a Python program to find the largest and smallest sum of the elements and mean of
the contents of a list of numbers.
13.Write a Python program to find the frequency of elements in a list using a dictionary. E.g.: For
the list
['apple','banana','apple','grapes','banana','guava']
the output should be
{'apple': 2, 'banana': 2, 'grapes': 1, 'guava': 1}
14.What will be the output of the following:
s = 'PYTHON'
s1= s[::-1]
print(s1)
15.Anurag wants to use the function sqrt() from the module math. Write a statement to help
Anurag to include only the sqrt() function in his program.
16.Give the output of the following NumPy code:
importnumpy as np
data = np.array([5,2,7,3,9])
print (data[:])
print(data[1:3])
print(data[:2])
print(data[-2:])
17.Write a NumPy code for creating and displaying subset of a given array A below:
If A {1, 3, 5}, then all the possible/proper subsets of A are { }, {1}, {3}, {5}, {1, 3}, {3, 5}
18.Differentiate between a NumPy array and list?
19.What will be the output of the following code shown below:
importnumpy as np
a = np.array([[3, 2, 1],[1, 2, 3]])
print(type(a))
print(a.shape)
print(a[0][1])
a[0][1] = 150
20.The output of the following snippet of code is either 1 or 2. State whether this statement is
true or false.
import random
random.randint(1,2)
print(a)
21.What will be the output of the following code for generating NumPy arrays using zeroes:
(i) np.zeros(10) (ii) np.zeros((3, 6)) (iii) np.zeros((2, 3, 2))
22.Write a Python program for performing linear search in an inputted list
23.What are the major functional component of a mobile system?
24.What is the role power management unit in mobile system?
25.What does the meaning of volatile primary memory? What can be done to overcome the
problem of volatility?
26.What is the significance of OS?
27.How are software libraries useful? Name some software libraries of python?
28.What is a variable?
29.What happens when you try to access the value of an undefined variable?
30.What is wrong with the following statement?
Number = input (“Number”)
Sqr = Number*Number
31.The ID() can be used to get the memory address of a variable. Consider the following code
and tell if the id( ) functions will return the same value or not ( as the value to be printed via
print( ))? Why ? (There are four print( ) function statements that are printing id of variable num
below)
Num=13
print((id(Num))
Num=Num+3
print((id(Num))
Num=Num-3
print((id(Num))
Num=”Hello”
print((id(Num))
31. What are ASCII and ISCII? Why are these used?
32. What is UNICODE? What is its significance?
33. Convert the following
(i)( 2345)10= ( ? )16(ii) (0100111010001)2 =( ? )8(iii) (200)10=( ?)2 (iv) (1010001)2 = (?)10(v)
(0100111010)2 = (?)8(vi) (266)8 = (?)2
(vii)(A13B) 16= (?)10
34. Why Python is interpreted?
35. What is the difference between interactive mode and script mode in Python?
36. What are the advantages of Python Programming language?
37. What are limitations of Python programming language?
38. What is the difference between an expression and a statement in Python?
39. Name some built-in literals of Python.
40. What is a comment in Python? In how many ways can you create comments in Python?
41. What are string literals in Python? How many types of strings are supported in Python?
42. How many integer types are supported by Python? Name them.
43. What are immutable and mutable types? List immutable and mutable types in Python.
44. What are augmented assignment operators? How are they useful?
45. How are following two expressions different? i. ans=8 ii. ans==8
46. What does the modulus operator do? What will be the result of 7.2 % 2.1 and 8%3?
47. How keyword differ from identifier?
48. What are operators? What is their function?
49. What types of conditional structures are present in programming language? How many of
them are supported in python?
50. Which loops are supported by python?Explain with syntax?
51. List some common data types used in Python. What is the difference between input() and
raw_input()? Explain with example.
52. Write a Python program to obtain temperature in Celsius and convert it into Fahrenheit
using formula.
53. Write a program to read two numbers and print their quotient and remainder.
54. Write a Python program to swap the content of two variables.
55. Write a Python program to calculate the factorial of a number.
56. Write a Python program to print Fibonacci series upto n terms.
57. Write a Python program to check whether a given character is an uppercase or a lowercase
character or a digit.
58. Write a Python program to print table from 5 to 10.
59. Write a Python program to calculate and print the sums of even and odd integers of the first
n natural numbers.
60. Write a Python program to input a number and test if it is a prime number.
61. Write a Python program to read an integer> 1000 and reverse the number.
62. Write a Python program to find the sum of digits entered/given as input.
63. Programs of series and pattern.

You might also like