100+ Python One Mark Questions with Answers Important Class 12

Share with others

Python One Mark Questions with Answers for Class 12

According to CBSE Latest Sample Paper – 2020. There are 21 Questions in Section 1 of Part A. Each Question is of One Mark. Student has to attempt only 15 questions out of 21. Division is as follows.

  1. Python ——————- 10 Questions.
  2. Networking ————–5 Questions.
  3. SQL ———————- 6 Questions.

Further Analytics of Python 10 Questions.

  1. Valid/Invalid Identifiers
  2. List Slicing/String Slicing
  3. File Handling
  4. Valid/Invalid Operators or any question on Operator
  5. Tuple/Dictionary/List
  6. Tuple/Dictionary/List
  7. Tuple/Dictionary/List
  8. Mathematical Function/String Function
  9. List/Tuple/Dictionary
  10. String

This article will give exposure of all expected Questions of Python(1 mark only), in the same pattern as given in CBSE Sample Paper.

Python Questions
Python Questions

Python One Mark Questions with Answers – Paper 1

Q1. Identify the valid identifier out of the following.

  1. item*qty
  2. $price
  3. for
  4. price

Q2. Write the output of the following

k = ['a', 'b', 'c', 'd', 'e']
print(k[-1 : -7 : -1])

Q3. Write the full form of CSV.

Q4. Write the membership Operator.

Q5. Tuple is a mutable or immutable type(T/F)

Python One Mark Questions with Answers

Q6. Name a function which is used to create empty dictionary.

Q7. Write the output of the following:

L = list("Python Questions")
print(L)

Q8. What is abs( ) function in python?

Q9. Fill in the blank in the following code:

import _________
print(_______.fabs(8))

Q10. Write the output of the following:

print(st[5 : 9] where st = “python questions”

Python One Mark Questions with Answers – Paper 2

Q1. Find the invalid identifier from the following:

  1. Myname
  2. Yourname
  3. True
  4. pricein$

Q2. Write the output of the following :

A = [1,2,3,4,5,6,7,8,9]
print(A[3,9])

Q3. _____________ module to be imported to work with CSV file.

Q4. Write a mathematical operator which returns the remainder.

Q5. The following declaration is of __________ (Tuple/Dictionary)

A = (“Amit”, “Sumit”, “Naman”)

Python One Mark Questions with Answers

Q6. Write the code to create a dictionary of three fruits:

Q7. Give example of two mutable data type.

Q8. What do you mean by len( ) function?

Q9. Write the output of the following:

D = {1 : 40, 2 : 50, 3 : 43}
print(D[1])

Q10. Name a string function which returns the first alphabet of string in upper case and rest in small case.

Python One Mark Questions with Answers – Paper 3

Q1. Identify the invalid identifier and specify the reason.

  1. Name
  2. Mytemp
  3. Templerun
  4. temp 123

Q2. Write the code to create an empty list named ‘temp’:

Q3. Write the type of file and the mode of opening file in the following code:

f = open(“data.txt”, “r+”)

Q4. Name the operator used in the following code and also write the output:

>>>7//3

Q5. Write the output of the following:

t = (1, 2, 3, "r")
print(t[2] + t[-3])

Python One Mark Questions with Answers

Q6. Write the output of the following:

L = list("String")
print(L[-5:-1])

Q7. Define get( ) function in reference to dictionary.

Q8. Which function returns this output of the given input string

Input String : python questions 
Output String : Python Questions

Q9. Write the output of the following :

L = {1 : 34, 3 : 45, 5 : 29}
s=0
for i in L:
    s=s+i
print(s)

Q10. What type of error is returned by the following code

s = "python practice"
s[5] = 'd

Python One Mark Questions with Answers – Paper 4

Q1. Which of the following can be used as identifiers in python?

  1. 4thnum
  2. Total
  3. for
  4. data

Q2. Write the output of the following :

L = ["20","30","40","50","60"]
if "20" in L:
  print(not(True))

Q3. Write the code to open binary file “data.dat” in append mode using ‘fobj’ as file handle

Q4. Write the output of the following code and also write the name of operator used.

print(34//4)

Q5. Write the output of the following :

L = ["20","30","40","50","60"]
s=0
c=3
for i in [1,2,3,5,4]:
   t=L[c]
   s=int(t) + i
   print(s)
   c=c-1
   

Python One Mark Questions with Answers

Q6. What do you mean by Traversing of String?

Q7. Write the output of the following:

s = "python questions"
for i in range(0,10,4):
      print(s[i+1])

 

Q8. Which function will return the largest value from a list of 10 numbers?

Q9. Is Tuple mutable or immutable?

Q10. Which function of string return True if the string contains only alphabets?

Python One Mark Questions with Answers – Paper 5

Q1. Find the invalid identifier from the following.

a. Mynum2

b. My2place

c. _myname

d. My name

Q2. Write the output of the following code.

p = (1,2)
b = (0,9)
print(p+b)

Q3. Fill the blanks in the following code :

import ________
with open("Text.csv", 'r') as ________
L = csv.reader(fin)
for line in ___:
       print(___________)

Q4. Write the name of the following operator

  1. //
  2. %

Q5. Which is mutable out of List and String?

Python One Mark Questions with Answers

Q6. Write the output of the following:

print((1,2,3,4,5).index(4))

Q7. Find error in the following code :

a = 7
while (a =>9)
    print(a)

Q8. Write the output of the following:

print(“Python One Mark Questions with Answers“.upper( ))

Q9. What will be return by following code :

def sum(q, e, r):
       print(q)

Q10. Write the statement to open “data.txt” file in append mode.

Python One Mark Questions with Answers – Paper 6

Q1. Which of the following are invalid identifiers?

  1. my_num_1
  2. 1st_name
  3. _
  4. yield

Q2. Write the output of the following.

z = "Python One Mark Questions with Answers"
m = "Q"
while m in z:
      print(m)

Q3. Write the output of the following.

print(2 + 0 == 2)

Q4. Write the output of the following:

L = ['11','22','33','44','55']
D = L
D[3]='SONU'
print(D)

Q5. Akhil wants to generate random integers between 2 and 9 (including both). He write the following code but missed the arguments in function, so please help him to write the correct code.

import random
print(random.randint())

Python One Mark Questions with Answers

Q6. Write the output of the following:

D = [11,22,33]
D.extend(44,55)
print(D)

Q7. A tuple is declared as List = (1,2,3,4,5). What will be the value of print(List[: : -1])?

Q8. Which module to be import to use the “sqrt( )” function?

Q9. Fill in the blank to find the maximum value from the list

List = [1,2,3,4,5]
print( _____ (List))

Q10. Write the output of the following:

a = "CS"
b = "IP"
print(a+b, "a+b" ,[a+b])

Python One Mark Questions with Answers – Paper 7

Q1. Which of the following is not a valid identifier name in Python?

a) 5NUM b) _Radius_ c) PICKLE d)While

Q2. What is the output when following code is executed?

>>>str1=”Python One Mark Questions with Answers”
>>>str1[11 : 15 : ]

Q3. In which mode the following file opens?

f = open(“Data.txt”)

Q4. Which of the following is a invalid relational operator in Python?

a) >= b) < c) >> d) ==

Q5. What type of error is returned by the following statements?

L = (23, 45, 34, 21, 1 )

L[1] = 25

Python One Mark Questions with Answers

Q6. Write a statement to declare a blank dictionary named “Dict” by using inbuilt function.

Q7. Fill in the blank

print(___________(1, 2, 3, 4, 5)) so that output is 5

Q8. Write the output of the following :

list1 = [2 * x for x in range(1,4)]

print(list1)

Q9. Identify the valid declaration of T:
L = [“J‟, “912‟, “EAR‟, 3]

a) dictionary b) string c) tuple d) list

Q10. Expand LIFO

Python One Mark Questions with Answers – Paper 8

Q1. Which of the following is a valid identifier name in Python?

a) for b) If c) while d) None of the above

Q2. What is the output of the following code

>>>B=”python one mark questions with answers”

>>>B[5:15:2]

Q3. Name any two file access modes in python.

Q4. What is the length of the tuple shown below?

>>>t=((((‘a’,9),’b’,’z’),’c’,2),’d’,0)

>>>t[0]

Q5. Which of the following is a valid Mathematical Operator in Python?
a) ? b) < c) =< d) //

Python One Mark Questions with Answers

Q6. Identify the valid declaration of ‘C’:
C =(‘I’ , ”Janyary” , 89)
(i)List (ii)Tuple (iii)String (iv)Dictionary

Q7. Name the built-in mathematical function / method that is used to return square root of a
number.

Q8. Identify the data type of ‘T’

T = list(tuple( (‘S’, ‘U’, ‘M’ , ‘A’ , ‘N’) ) )

Q9. Write the output of the following python code:

Q = “PHYTHON MARK”

print(Q.isupper( ))

Q10. Which operator is used in the python to import all modules from packages?
(a) . operator (b) * operator (c) -> symbol (d) = operator

Python One Mark Questions with Answers – Paper 9

Q1. Which of the following is a invalid identifier name in Python? And justify your answer.

a) 23Kg b) 23@Kg c) Kg23 d) Kg_23

Q2. Declare a dictionary with keys 10, 20, 30 and Values ‘A’, ‘B’ and ‘C’ respectively.

Q3. Name two file modes in which new file created (while opening) if the file does not exist.

Q4. Write the output of the following :

>>> A = “Class XII”

>>> A[-3 : ]

Q5. Name the Python Library modules which need to be imported to invoke the load( ) function.

Python One Mark Questions with Answers

Q6. Write the output of the following :

>>> A = (“10” , “A” , 20 , “B” , 30)

>>> B = A[2 : 4]

>>>type(B)

Q7. Explain floor( ) function with the help of example.

Q8. What will be the output of the following Python code?

>>>A = (11, 22, 33)

>>>2 * A

Q9. Name the Python Library modules which need to be imported to invoke the pow( ) function :

Q10. Identify the valid arithmetic operator in Python from the following.
a) ? b) < c) ** d) and

Python One Mark Questions with Answers – Paper 10

Q1. Write any two keywords of python.

Q2. Write the output of the following.

>>> 123 // 5

Q3. Name the Python Library modules which need to be imported to invoke the uniform( ) function :

Q4. A tuple is declared as T = ((100,35), (10,20,40), (50,30), (1, 2, 3, 4))
What will be the value of max(T) ?

Q5. Evaluate the following expressions:

a) 5<10 or 12<7 and not 3>18

Python One Mark Questions with Answers

Q6. How can you access a global variable inside the function, if function has a variable with same name.

Q7. What do you mean by actual or formal parameters ?

Q8. Write a statement to open a file “data.txt” in append mode.

Q9. What is random( ) function?

Q10. Expand LIFO.


Disclaimer : I tried to give you the correct “Python One Mark Questions with Answers ” , but if you feel that there is/are mistakes in the Python One Mark Questions with Answers given above, you can directly contact me at csiplearninghub@gmail.com.


Class 12 Computer Science Sample Paper 2020-2021.

Class 12 Computer Science Sample Paper Marking Scheme

Class 12 Computer Science Test Series


Share with others

Leave a Reply

error: Content is protected !!
%d bloggers like this: