1. Which of the following is a valid data type in Python? A. int B. num C. digit D. number Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A Solution: The data type for integers in Python is int.
2. What is the result of type(3.14) ? A. float B. int C. double D. numeric Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A Solution: The type() function returns the data type of the argument.
3. What data type is used to represent a sequence of characters in Python? A. string B. char C. text D. str Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D Solution: The data type for sequences of characters in Python is str.
4. What is the purpose of the str() function in Python? A. To convert a string to a number B. To format strings C. To concatenate strings D. To convert a number to a string Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D Solution: The str() function converts a number or other data type to a string.
5. Which of these in not a core data type? A. Lists B. Dictionary C. Tuples D. Class Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
6. Given a function that does not return any value, What value is thrown by default when executed in shell. A. int B. bool C. void D. None Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
7. What is the result of type(True) ? A. true B. bool C. boolean D. Boolean Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B Solution: The data type for boolean values in Python is bool.
8. In order to store values in terms of key and value we use what core data type. A. list B. tuple C. class D. dictionary Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
9. How do you create a floating-point number in Python? A. 5.0 B. 5 C. "5.0" D. float(5) Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A Solution: Floating-point numbers can be created using the decimal point notation, like 5.0.
10. What is the result of int(3.9) ? A. 3 B. 3.9 C. 4 D. 4.0 Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A Solution: The int() function converts a floating-point number to an integer by truncating the decimal part.