21. What will be the output of the following Python function?
oct(7)
oct(‘7’)
oct(7)
oct(‘7’)
22. What is the output of the following code:
my_list = [1, 2, 3, 4]
print(sum(my_list))
my_list = [1, 2, 3, 4]
print(sum(my_list))
23. What will be the output of the following Python functions?
chr(‘97’)
chr(97)
chr(‘97’)
chr(97)
24. What is the output of the following code:
my_list = [5, 8, 2, 6]
print(max(my_list))
my_list = [5, 8, 2, 6]
print(max(my_list))
25. What will be the output of the following code:
my_string = " Hello, World! "
print(my_string.strip())
my_string = " Hello, World! "
print(my_string.strip())
26. What will be the output of the following code:
my_string = "Hello, World!"
print(my_string.lower())
my_string = "Hello, World!"
print(my_string.lower())
27. What will be the output of the following Python function?
complex(1+2j)
complex(1+2j)
28. Which built-in function is used to convert a value to a string?
29. What does the built-in function type() do in Python?
30. What will be the output of the following Python function?
float(' -12345\n')
(Note that the number of blank spaces before the number is 5)
float(' -12345\n')
(Note that the number of blank spaces before the number is 5)