Humanities/Arts Exam  >  Humanities/Arts Tests  >  Computer Science for Class 11  >  Test: Tuples Manipulation in Python - Humanities/Arts MCQ

Test: Tuples Manipulation in Python - Humanities/Arts MCQ


Test Description

10 Questions MCQ Test Computer Science for Class 11 - Test: Tuples Manipulation in Python

Test: Tuples Manipulation in Python for Humanities/Arts 2024 is part of Computer Science for Class 11 preparation. The Test: Tuples Manipulation in Python questions and answers have been prepared according to the Humanities/Arts exam syllabus.The Test: Tuples Manipulation in Python MCQs are made for Humanities/Arts 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Tuples Manipulation in Python below.
Solutions of Test: Tuples Manipulation in Python questions in English are available as part of our Computer Science for Class 11 for Humanities/Arts & Test: Tuples Manipulation in Python solutions in Hindi for Computer Science for Class 11 course. Download more important topics, notes, lectures and mock test series for Humanities/Arts Exam by signing up for free. Attempt Test: Tuples Manipulation in Python | 10 questions in 10 minutes | Mock test for Humanities/Arts preparation | Free important questions MCQ to study Computer Science for Class 11 for Humanities/Arts Exam | Download free PDF with solutions
Test: Tuples Manipulation in Python - Question 1

What will be the output of the following Python code?

numberGames = {}
numberGames[(1,2,4)] = 8
numberGames[(4,2,1)] = 10
numberGames[(1,2)] = 12
sum = 0
for k in numberGames:
    sum += numberGames[k]
print len(numberGames) + sum

Detailed Solution for Test: Tuples Manipulation in Python - Question 1

Tuples can be used for keys into dictionary. The tuples can have mixed length and the order of the items in the tuple is considered when comparing the equality of the keys.

Test: Tuples Manipulation in Python - Question 2

What will be the output of the following Python code?

>>>t1 = (1, 2, 4, 3)
>>>t2 = (1, 2, 3, 4)
>>>t1 < t2

Detailed Solution for Test: Tuples Manipulation in Python - Question 2

Elements are compared one by one in this case.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: Tuples Manipulation in Python - Question 3

What will be the output of the following Python code?

d = {"john":40, "peter":45}
d["john"]

Detailed Solution for Test: Tuples Manipulation in Python - Question 3

Execute in the shell to verify.

Test: Tuples Manipulation in Python - Question 4

What will be the output of the following Python code?

>>>t=(1,2,4,3)
>>>t[1:-1]

Detailed Solution for Test: Tuples Manipulation in Python - Question 4

Slicing in tuples takes place just as it does in strings.

Test: Tuples Manipulation in Python - Question 5

Suppose t = (1, 2, 4, 3), which of the following is incorrect?

Detailed Solution for Test: Tuples Manipulation in Python - Question 5

Values cannot be modified in the case of tuple, that is, tuple is immutable.

Test: Tuples Manipulation in Python - Question 6

What will be the output of the following Python code?

>>>my_tuple = (1, 2, 3, 4)
>>>my_tuple.append( (5, 6, 7) )
>>>print len(my_tuple)

Detailed Solution for Test: Tuples Manipulation in Python - Question 6

Tuples are immutable and don’t have an append method. An exception is thrown in this case.

Test: Tuples Manipulation in Python - Question 7

What will be the output of the following Python code?

>>>t = (1, 2)
>>>2 * t

Detailed Solution for Test: Tuples Manipulation in Python - Question 7

* operator concatenates tuple.

Test: Tuples Manipulation in Python - Question 8

What will be the output of the following Python code?

>>>t = (1, 2, 4, 3, 8, 9)
>>>[t[i] for i in range(0, len(t), 2)]

Detailed Solution for Test: Tuples Manipulation in Python - Question 8

Execute in the shell to verify.

Test: Tuples Manipulation in Python - Question 9

What will be the output of the following Python code?

>>>t=(1,2,4,3)
>>>t[1:3]

Detailed Solution for Test: Tuples Manipulation in Python - Question 9

Slicing in tuples takes place just as it does in strings.

Test: Tuples Manipulation in Python - Question 10

Which of the following is a Python tuple?

Detailed Solution for Test: Tuples Manipulation in Python - Question 10

Tuples are represented with round brackets.

20 videos|20 docs|5 tests
Information about Test: Tuples Manipulation in Python Page
In this test you can find the Exam questions for Test: Tuples Manipulation in Python solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Tuples Manipulation in Python, EduRev gives you an ample number of Online tests for practice

Top Courses for Humanities/Arts

20 videos|20 docs|5 tests
Download as PDF

Top Courses for Humanities/Arts