Data Science · Python Which of the following statements about floats in Python is true? A Floats cannot represent negative numbers. B Floats have infinite precision. C Floats are always displayed with a fixed number of decimal places. D Floats can be used to represent fractions accurately. Correct answer MCQSEXAM Show answer Read explanation
Data Science · Python What is the result of round(3.75) in Python? A 4.0 Correct answer B 3.75 C 3 D Error MCQSEXAM Show answer Read explanation
Data Science · Python What will be the output of len({'a': 1, 'b': 2, 'c': 3}) in Python? A 1 B 2 C 3 Correct answer D Error MCQSEXAM Show answer Read explanation
Data Science · Python Which method is used to retrieve all keys from a dictionary in Python? A keys() Correct answer B values() C items() D get() MCQSEXAM Show answer Read explanation
Data Science · Python What will be the result of len(['apple', 'banana', 'orange']) in Python? A 3 Correct answer B 6 C 7 D Error MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following statements about tuples is true? A Tuples can be modified after creation. B Tuples use curly braces {} for declaration. C Tuples support duplicate elements. Correct answer D Tuples can only contain integers. MCQSEXAM Show answer Read explanation
Data Science · Python What will be the result of len({1, 2, 3, 4, 5}) in Python? A 1 B 5 Correct answer C 0 D Error MCQSEXAM Show answer Read explanation
Data Science · Python Which method is used to add an element to a set in Python? A push() B add() Correct answer C append() D insert() MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following methods removes the last element from a list in Python? A pop() Correct answer B remove() C del() D clear() MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following is not a valid boolean value in Python? A TRUE Correct answer B False C 0 D True MCQSEXAM Show answer Read explanation
Data Science · Python What is the result of not False in Python? A True Correct answer B False C 1 D 0 MCQSEXAM Show answer Read explanation
Data Science · Python Which method is used to find the index of the first occurrence of a substring in a string? A index() B find() Correct answer C search() D locate() MCQSEXAM Show answer Read explanation
Data Science · Python What is the output of "python"[::-1] in Python? A "python" B "nohtyp" Correct answer C "nythop" D Error MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following is a valid float representation in Python? A 2e3 Correct answer B 0b101 C '3.14' D [1, 2, 3] MCQSEXAM Show answer Read explanation
Data Science · Python What will be the result of 4.2 * 3 in Python? A 12.6 Correct answer B 12 C 13 D 1.4 MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following is not a valid way to represent an integer in Python? A 100 B 0xFF C 3.14 Correct answer D -42 MCQSEXAM Show answer Read explanation
Data Science · Python What will be the output of 7 % 3 in Python? A 2 B 3 C 1 Correct answer D 0 MCQSEXAM Show answer Read explanation
Data Science · Python Which method is used to remove a key-value pair from a dictionary in Python? A remove() B pop() Correct answer C delete() D discard() MCQSEXAM Show answer Read explanation
Data Science · Python How do you access the value associated with the key 'age' in a dictionary named person in Python? A person['age'] Correct answer B person.get('age') C person.value('age') D person[age] MCQSEXAM Show answer Read explanation
Data Science · Python What is the result of {1, 2, 3} | {3, 4, 5} in Python? A {1, 2, 3, 4, 5} Correct answer B {1, 2} C {3} D Error MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following is a valid way to create an empty set in Python? A set() Correct answer B {} C {0} D {1, 2, 3} MCQSEXAM Show answer Read explanation
Data Science · Python Can you change the elements of a tuple after it has been created? A Yes B No Correct answer C Only if it contains integers D Only if it contains strings MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following is a characteristic of tuples in Python? A Mutable B Indexed Correct answer C Unordered D Duplicates allowed MCQSEXAM Show answer Read explanation
Data Science · Python Which method is used to add an element to the end of a list in Python? A append() Correct answer B insert() C extend() D remove() MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following is a valid way to assign a boolean value in Python? A true B FALSE C True Correct answer D 0 MCQSEXAM Show answer Read explanation