11. What is the data type of the result of 10 / 2 ? A. int B. float C. double D. numeric Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B Solution: Division of two integers results in a floating-point number.
12. How do you convert a string containing an integer to an integer data type? A. int("5") B. integer("5") C. to_int("5") D. convert("5", int) Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A Solution: The int() function converts a string containing an integer to an integer.
13. Which of the following is not a numeric data type in Python? A. int B. float C. str D. complex Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C Solution: str is a string data type, not a numeric data type.
14. What is the result of complex(3, 4) ? A. 3 B. 4 C. 3 + 4i D. 7 Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C Solution: The complex() function creates a complex number in the form real + imaginary.
15. What is the purpose of the round() function in Python? A. To round up a number B. To round down a number C. To round a number to the nearest integer D. To round a number to a specified number of decimal places Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D Solution: The round() function rounds a number to a specified number of decimal places.
16. What is the type of inf? A. Boolean B. Integer C. Float D. Complex Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
17. What is the result of 5 + 3.0 ? A. 8 B. 8.0 C. 53.0 D. 53 Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B Solution: When an integer and a floating-point number are added, the result is a floating-point number.
18. What is the result of "5" + "3" ? A. 8 B. "8" C. 53 D. "53" Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D Solution: The + operator concatenates strings, so "5" + "3" results in "53".
19. What is the result of "5" * 3 ? A. 15 B. 8 C. "555" D. "53" Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C Solution: The * operator repeats a string a specified number of times.
20. What is the result of 5 // 2 ? A. 2.5 B. 2 C. 2.0 D. 3 Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B Solution: The // operator performs floor division, resulting in the quotient without the fractional part.