We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
Viva Questions
1. What are operators and operands in Python?
2. What are the best practices for naming and using variables in Python? 3. What is the modulus operator, and how is it used? 4. What are Boolean expressions, and how are they used in conditional statements? 5. Explain the difference between 'if', 'elif', and 'else' statements. 6. How do nested conditionals work in Python? Provide an example. 7. How does a 'while' loop work in Python? 8. What is a function call in Python? Give an example. 9. How does type conversion and coercion work in Python functions? 10. Name and explain some common math functions in Python. 11. What are parameters and arguments in the context of functions? 12. Explain recursion with an example. 13. How do you find the length of a string in Python? 14. Explain string slicing with examples. 15. What is the purpose of the 'find' function in strings? 16. What are list values, and how do you determine the length of a list? 17. How can you delete elements from a list? 18. What is the difference between mutability in lists and tuples? 19. What are the key operations and methods associated with dictionaries? 20. What is aliasing and copying in tuples and dictionaries? 21. How do you create a class in Python? 22. What are instance objects, and how do you create them? 23. How do you access attributes in a class? 24. What is class inheritance, and how is it implemented in Python? 25. Explain the concept of overriding methods in OOP. 26. What is data hiding in OOP? 27. What is function overloading, and how is it used? 28. How do you read from and write to text files in Python? 29. What is pickling in Python, and how is it used? 30. How do you handle the ZeroDivisionError exception? 31. Explain the use of try-except blocks with an example. 32. What is the purpose of the 'else' block in exception handling? 33. How do you handle the FileNotFoundError exception? 34. What is a regular expression, and why is it useful? 35. Describe various types of regular expressions with examples. 36. How do you use the 'match' function in regular expressions? 37. Explain how web scraping can be performed using regular expressions. 38. What are logical operators, and how are they used in Python? 39. Explain the difference between 'and', 'or', and 'not' operators with examples. 40. How do you use the modulus operator to determine if a number is even or odd? 41. What is the purpose of using nested conditionals? Provide an example. 42. How do you define a function with default arguments in Python? 43. Explain the concept of variable scope in Python functions. 44. How can you pass a list as an argument to a function? 45. What are lambda functions, and how are they used? 46. Describe a scenario where recursion is more beneficial than iteration. 47. What are the base case and recursive case in a recursive function? 48. How do you concatenate strings in Python? 49. What are escape characters in strings, and how are they used? 50. Explain how string formatting works in Python. 51. How can you convert a string to a list of characters? 52. Describe the 'strip', 'rstrip', and 'lstrip' methods with examples. 53. How do you create a list with list comprehensions? 54. Explain the difference between 'append' and 'extend' methods in lists. 55. How can you sort a list in ascending and descending order? 56. What are shallow and deep copies of lists? Provide examples. 57. How can you reverse a list in Python? 58. How do you create a tuple in Python? 59. What are the advantages of using tuples over lists? 60. Explain how to convert a list to a tuple and vice versa. 61. How do you access dictionary keys, values, and items? 62. What is the difference between 'pop' and 'popitem' methods in dictionaries? 63. How can you merge two dictionaries in Python? 64. What are the main components of a class in Python? 65. Explain the concept of a constructor in Python classes. 66. How do you create and use instance methods in a class? 67. What are class variables and instance variables? 68. How can you implement method overloading in Python? 69. What is polymorphism in OOP, and how is it implemented in Python? 70. Explain the concept of multiple inheritance in Python. 71. How do you use the 'super' function in class inheritance? 72. What is encapsulation, and how is it achieved in Python? 73. How does method overriding work in Python? 74. How do you read a file line by line in Python? 75. What is the difference between binary and text files? 76. How can you write data to a CSV file in Python? 77. What is the purpose of the 'finally' clause in exception handling? 78. How do you handle multiple exceptions in a single try-except block? 79. What is the use of the 'with' statement when working with files? 80. How do you compile a regular expression pattern in Python? 81. Explain the difference between 'match' and 'search' functions in regular expressions. 82. What are character classes in regular expressions? Provide examples. 83. How do you use regular expressions to replace text in a string? 84. Describe the use of quantifiers in regular expressions with examples. 85. How can you extract email addresses from a text using regular expressions?