Instruction:-
#1. Which of the following is an immutable data type?
#2. What is the output of t=(2,3,4,3.5,5,6);
print(sum(t)+t.count(2))?
#3. Which function is used to shuffle a list in Python?
#4. What is the output of str1=”helloworld”;
print(str1[::-1])?
#5. Which of the following is correct regarding dictionaries in Python?
#6. What is the common difference in the arithmetic sequence: 3, 7, 11, 15, …?
#7. What is the sum of the first 10 terms of the arithmetic sequence: 2, 5, 8, 11, …?
#8. Which of the following is an immutable data type?
#9. What is the output of t=(2,3,4,3.5,5,6);
print(sum(t)+t.count(2))?
#10. What is the output of the following code?
print(type(“123”))
#11. What is the index of the last element in the list my_list = [‘a’, ‘b’, ‘c’]?
#12. Which of the following is a mutable data type in Python?
#13. Which of these is a correct way to declare a tuple in Python?
#14. Which Python data type is used to store key-value pairs?
#15. What will be the output of the following code?
x = [1, 2, 3]
x[1] = 4
print(x)
#16. What is the correct syntax to access the second element in a list my_list?
#17. What is the result of len(“Hello”)?
#18. Which of the following is not a sequence data type?
#19. What will be the output of the following?
my_tuple = (1, 2, 3)
my_tuple[0] = 10
#20. Which of the following data types is immutable?
#21. What will be the result of the following code?
a = [1, 2, 3]
print(a[-1])
#22. Which data type would be most appropriate to store unique values only?
#23. What is the result of this operation?
“abc” + “def”
#24. What will be the output of:
my_list = [10, 20, 30]
print(len(my_list))
#25. Which of the following is a valid dictionary?
Previous
Finish