0% found this document useful (0 votes)
23 views3 pages

Question On Python Datatypes and Built in Functions

Uploaded by

sfiza27
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
23 views3 pages

Question On Python Datatypes and Built in Functions

Uploaded by

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

Question on Python Datatypes and built-in functions

1. What are the basic data types?


2. How do you declare a variable?
3. What is dynamic typing?
4. Explain the difference between lists and tuples.
5. How do you access elements in a list?
6. What is the syntax for creating a tuple?
7. Can you change the value of a tuple after it has been created?
8. What is a dictionary?
9. How do you access values in a dictionary?
10. What is the difference between a set and a list?
11. How do you create an empty list?
12. How do you create an empty dictionary?
13. How do you create an empty set?
14. What is the difference between the "==" operator and the "is" keyword?
15. Explain the concept of mutable and immutable objects.
16. What is the difference between shallow copy and deep copy?
17. How do you check the data type of a variable?
18. What is the purpose of the "type()" function?
19. Explain the concept of type casting.
20. What are the numeric data types?
21. What is the difference between integers and floating-point numbers?
22. How do you convert a string to an integer?
23. How do you convert an integer to a string?
24. What is the purpose of the "len()" function?
25. How do you concatenate two strings?
26. What is the "in" keyword used for?
27. How do you create a multiline string?
28. How do you remove whitespace from the beginning or end of a string?
29. What are escape sequences?
30. How do you use string formatting?
31. What are the common string methods?
32. How do you check if a string contains a substring?
33. What is the purpose of the "split()" method?
34. How do you replace substrings in a string?
35. How do you convert a string to uppercase or lowercase?
36. What is the difference between a function and a method?
37. How do you define a function?
38. What is the purpose of the "return" statement functions?

TITUS NEWTON 1
39. How do you call a function?
40. What is a lambda function?
41. How do you define a lambda function?
42. What are the advantages of using lambda functions?
43. How do you use the "map()" function?
44. What is the purpose of the "filter()" function?
45. How do you use list comprehensions?
46. What is a generator?
47. How do you define a generator function?
48. What is the purpose of the "yield" keyword?
49. What is the difference between a list and a generator?
50. How do you iterate over elements in a list?
51. How do you iterate over key-value pairs in a dictionary?
52. How do you iterate over characters in a string?
53. What are the comparison operators?
54. How do you use comparison operators in conditional statements?
55. What is the purpose of the "if" statement?
56. How do you use the "else" statement?
57. How do you use the "elif" statement?
58. What is the purpose of the "and" and "or" keywords?
59. How do you use the "not" keyword?
60. What is the purpose of the "in" and "not in" keywords?
61. How do you use the "is" and "is not" keywords?
62. What is the purpose of the "pass" statement?
63. How do you use the "while" loop?
64. How do you use the "for" loop?
65. What is the purpose of the "range()" function?
66. How do you use the "break" statement in a loop?
67. How do you use the "continue" statement in a loop?
68. What is the purpose of the "enumerate()" function?
69. How do you use the "zip()" function?
70. How do you sort a list?
71. What is the purpose of the "sorted()" function?
72. How do you reverse a list?
73. How do you find the maximum or minimum value in a list?
74. How do you remove duplicates from a list?
75. What is a tuple unpacking?
76. How do you swap the values of two variables?
77. How do you check if a key exists in a dictionary?
78. How do you add a new key-value pair to a dictionary?

TITUS NEWTON 2
79. How do you remove a key-value pair from a dictionary?
80. How do you copy a dictionary?
81. How do you merge two dictionaries?
82. How do you check if a set is a subset of another set?
83. How do you add elements to a set?
84. How do you remove elements from a set?
85. What is the purpose of the "intersection()" method sets?
86. What is the purpose of the "union()" method sets?
87. What is the purpose of the "difference()" method sets?
88. What is the purpose of the "symmetric_difference()" method sets?
89. How do you create a frozen set?
90. What is the purpose of the "all()" function?
91. What is the purpose of the "any()" function?
92. What is the purpose of the "max()" function?
93. What is the purpose of the "min()" function?
94. What is the purpose of the "sum()" function?
95. What is the purpose of the "enumerate()" function?
96. What is the purpose of the "reversed()" function?
97. What is the purpose of the "zip()" function?
98. How do you convert a list to a tuple?
99. How do you convert a tuple to a list?
100. How do you convert a list to a set?

TITUS NEWTON 3

You might also like