Data Science · Python What will be the result of (1, 2) + (3, 4) in Python? A (1, 2, 3, 4) Correct answer B (1, 2) (3, 4) C (4, 3, 2, 1) D Error MCQSEXAM Show answer Read explanation
Data Science · Python Which method is used to remove leading and trailing whitespace from a string in Python? A trim() B strip() Correct answer C clean() D remove() MCQSEXAM Show answer Read explanation
Data Science · Python Which method is used to reverse the elements of a list in place? A reverse() Correct answer B invert() C flip() D revolve() MCQSEXAM Show answer Read explanation
Data Science · Python What will be the result of [x for x in range(5)] in Python? A [0, 1, 2, 3, 4] Correct answer B [1, 2, 3, 4, 5] C [1, 2, 3, 4] D [0, 1, 2, 3] MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following expressions returns False? A bool(0) Correct answer B bool("") C bool([]) D bool(None) MCQSEXAM Show answer Read explanation
Data Science · Python What will be the output of True + True in Python? A 0 B 1 C 2 Correct answer D True MCQSEXAM Show answer Read explanation
Data Science · Python What is the result of "Python"[::-1] in Python? A "Python" B "nohtyP" Correct answer C "nohtyP" D "ythoPn" MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following methods is used to retrieve the fractional and integer parts of a float separately? A frac() B modf() Correct answer C fraction() D split() MCQSEXAM Show answer Read explanation
Data Science · Python What will be the result of 0.1 + 0.2 == 0.3 in Python? A True B False Correct answer C Error D Undefined MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following statements about integer division in Python 3.x is true? A Integer division always rounds down the result. Correct answer B Integer division always rounds up the result. C Integer division returns a float. D Integer division is not supported in Python 3.x. MCQSEXAM Show answer Read explanation
Data Science · Python What is the output of 2 ** 3 ** 2 in Python? A 64 B 512 Correct answer C 81 D 729 MCQSEXAM Show answer Read explanation
Data Science · Python What will be the output of {'a': 1, 'b': 2}.values() in Python? A [1, 2] Correct answer B {'a': 1, 'b': 2} C (1, 2) D Error MCQSEXAM Show answer Read explanation
Data Science · Python Which method is used to update a dictionary with elements from another dictionary or iterable? A update() Correct answer B merge() C append() D extend() MCQSEXAM Show answer Read explanation
Data Science · Python What will be the result of {1, 2, 3} & {3, 4, 5} in Python? A {1, 2} B {3} Correct answer C {3, 4, 5} D Error MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following methods removes all elements from a set in Python? A remove() B clear() Correct answer C pop() D discard() MCQSEXAM Show answer Read explanation
Data Science · Python What will be the result of ('a', 'b') + ('c',) in Python? A ('a', 'b', 'c') Correct answer B ('a', 'b', 'c', 'd') C ('a', 'b', 'd', 'c') D Error MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following methods returns the number of occurrences of a specified value in a tuple? A count() Correct answer B index() C get() D len() MCQSEXAM Show answer Read explanation
Data Science · Python What will be the result of ['a', 'b', 'c'] * 2 in Python? A ['a', 'b', 'c', 'a', 'b', 'c'] Correct answer B [['a', 'b', 'c'], ['a', 'b', 'c']] C ['aa', 'bb', 'cc'] D Error MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following methods removes the first occurrence of a specific value from a list in Python? A pop() B remove() Correct answer C del() D clear() MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following statements about strings in Python is true? A Strings can contain both letters and numbers. Correct answer B Strings are mutable. C Strings can only contain ASCII characters. D Strings can be represented using single quotes but not double quotes. MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following statements about booleans in Python is true? A Booleans are represented as 1 and 2. B Booleans can only be assigned with the True keyword. C Booleans are a subclass of integers. Correct answer D Booleans cannot be used in conditional statements. MCQSEXAM Show answer Read explanation
Data Science · Python What is the result of True or False in Python? A True Correct answer B False C 1 D 0 MCQSEXAM Show answer Read explanation
Data Science · Python What is the result of "hello".upper() in Python? A "hello" B "HELLO" Correct answer C "Hello" D Error MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following statements about integers in Python is true? A Integers can have leading zeros. B Integers can have a decimal point. C Integers can be represented in binary format. Correct answer D Integers can contain letters. MCQSEXAM Show answer Read explanation
Data Science · Python What is the result of abs(-5) in Python? A 5 Correct answer B -5 C 0 D Error MCQSEXAM Show answer Read explanation