Python Viva Questions

Python Viva Questions
CLICK FOR CLASS 12 COMPUTER SCIENCE PRACTICAL QUESTION PAPER (SOLVED)
Click for SQL Viva Questions
Q1. What is Python?
Q2. Name two modes of Python.
Q3. Write Full Form of IDLE
Q4. In which mode we get result immediately after executing the command?
Q5. What do you mean by comments in Python?
Python Viva Questions
Q6. Which symbols are used for single line comments and multiple line comments?
Q7. What do you mean by variable?
Q8. Write code to find the address of variable ‘x’
>>>id(x)
Q9. What do you mean by data type?
Q10. Name five primitive data type in python.
Python Viva Questions

CLICK FOR CLASS 12 COMPUTER SCIENCE PRACTICAL QUESTION PAPER (SOLVED)
Q11. Which method is used to accept data from the user?
Q12. Write three numeric data type in python.
Q13. Name three sequential data types in python.
Q14. Which data type store the combination of real and imaginary numbers?
Q15. Write the output of the following:
>>> 4.7e7
>>> 3.9e2
47000000
390
Python Viva Questions
Q16. Write the output of the following :
- >>> (75 > 2 **5)
- >>> (25 != 5 *2)
1. True
2. True
Q17. Write the code to display all keywords in python.
Q18. Write the output of the following
>>> str = "Informatics" >>>str[3] = 'e' >>> print(str)
Q19. What do you mean by Escape sequence?
Q20. What is None data type?
for example
m = none, Now the variable ‘m’ is not pointing to any value, instead it is pointing to none.
Python Viva Questions
Q21. What do you mean by Operator?
Q22. What is the output of 2 % 5?
Q23. What is the difference between ‘=’ and ‘==’ operator?
Q24. What is the difference between ‘a’ and “a” in python?
Q25. What is the difference between ‘/’ and ‘//’ operator?
for example: >>> 5 / 2 returns 2.5 >>> 5 // 2 returns 2
Python Viva Questions
Q26. Give an example of infinite loop.
Ans. while True: print("A")
Q27. What is the purpose of break statement?
Q28. Write the output of the following :
>>> x = 8
>>> x = 5
>>> print (x + x)
Q29. Identify the invalid variable names from the following and specify the reason also.
a) m_n
b) unit_day
c) 24Apple
d) #sum
e) for
f) s name
24apple : Variable can not start with number
#sum : Variables can not start from special character.
for : Keyword can not be used as variable
s name : Spaces are not allowed in variable names
Q30. What do you mean by binary and unary operators? Give one example of each.
2 / 3
4 * 3
Unary operators work only on one operand like Subtraction (-)
-9
-7
Python Viva Questions
Q31. Write the name and purpose of the following operators.
//
%
**
// : Name of Operator is Floor Division . It is used to find the integer part of the quotient when one number is divided by other
% : Name is Modulus or Remainder Operator . It is used to find the remainder when one number is divided by other
** : Name is Exponent. It is used to find the power of a number like 2**3 will give result 8.
Q32. What is the difference between eval() and int() function?
for example :
print(eval(12)) returns error
print(int(12)) returns 12
Q33. What is the difference between Lists and Tuples?
Lists Tuples List are mutable Not Mutable Elements enclosed in Square brackets Elements enclosed in parenthesis
Q34. Write the code to reverse a list named L1.
Q35. What is string in python?
Python Viva Questions
Q36. What do you mean by Traversing String in Python?
Q37. What do you mean by Replicating String?
Q38. What is String slicing?
Q39. What is the purpose of Try and Except in Python?
Q40. What is append( ) function in reference to list?
Python Viva Questions
Q41. Can we print only keys of a dictionary?
Q42. How can you print only keys of a dictionary without using keys( ) method?
d = {1 : “A”, 2 : “B”, 3 : “C”}
Ans. d = {1 : "A", 2 : "B", 3 : "C"} for i in d: print(i)
Q43. What is the difference between actual argument and formal argument?
Q44. Name the four types of actual arguments in python.
Q45. What is argument?
Python Viva Questions
Q46. What is the meaning of Scope of Variable?
Q47. What is the difference between global and local variable?
Q48. What is Recursion?
Q49. Define module in python.
Q50. Name any two built in module.
Python Viva Questions
Q51. Which module is to be imported for sqrt( ), mean( ) and load()functions.
Q52. What is the difference between Text file and Binary File.
Text File Binary File These files can be read by human directly These files can not be read by humans directly. Each line is terminated by a special character ,
known as EOLNo delimiter for a line Processing of file is slower than binary file Processing of file is faster than text file
Q53. Name the function which is used to open or close file in python.
Q54. Name three modes of opening a file.
Q55. What is the difference between read( ) and read(n) method?
Python Viva Questions
Q56. What is the difference between readline( ) and readlines() method?
readlines() : This function is used to read all the lines from the file.
Q57. What does the readlines( ) method returns?
Q58. What is the difference between write( ) and writelines( ) method?
writelines() : This method is used for writing the sequence data type like list, tuple or string into a file.
Q59. Expand FIFO.
Q60. Expand LIFO
CLICK FOR CLASS 12 LATEST COMPUTER SCIENCE PRACTICAL QUESTION PAPER (SOLVED)
Click for SQL Viva Questions
Python Viva Questions
Disclaimer : I tried to give you the correct answers of “Python Viva Questions ” , but if you feel that there is/are mistakes in the answers of “Python Viva Questions “ 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








