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
Data Science · Python How do you access the third element of a list named my_list in Python? A my_list[2] Correct answer B my_list[3] C my_list[1] D my_list[0] MCQSEXAM Show answer Read explanation
Data Science · Python What is the result of True and False in Python? A True B False Correct answer C 1 D 0 MCQSEXAM Show answer Read explanation
Data Science · Python Which method is used to convert a string to lowercase in Python? A upper() B capitalize() C lower() Correct answer D swapcase() MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following is a valid float in Python? A 10 B -5.6 Correct answer C '3.14' D [1, 2, 3] MCQSEXAM Show answer Read explanation
Data Science · Python What is the result of 'hello' + 'world' in Python? A 'helloworld' Correct answer B 'hello world' C 'hello' 'world' D Error MCQSEXAM Show answer Read explanation
Data Science · Python What is the result of 3.5 + 2 in Python? A 5 B 5.5 Correct answer C 6 D 3.7 MCQSEXAM Show answer Read explanation
Data Science · Python Which of the following is an invalid integer in Python? A 123 B -456 C 0 D 12.34 Correct answer MCQSEXAM Show answer Read explanation