Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

Programming in Python - - Unit 7 - Week 7 (Content)_ Introduction to tuples_

The document outlines the content and assessment details for Week 7 of a Python programming course, focusing on tuples. It includes various questions related to tuples, their properties, and operations, along with accepted answers and scores for each question. The document also specifies submission details and the due date for the assignment.

Uploaded by

rvseceprint
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Programming in Python - - Unit 7 - Week 7 (Content)_ Introduction to tuples_

The document outlines the content and assessment details for Week 7 of a Python programming course, focusing on tuples. It includes various questions related to tuples, their properties, and operations, along with accepted answers and scores for each question. The document also specifies submission details and the due date for the assignment.

Uploaded by

rvseceprint
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

4/23/24, 3:23 AM Programming in Python - - Unit 7 - Week 7 (Content): Introduction to tuples.

(https://swayam.gov.in) (https://swayam.gov.in/nc_details/CEC)

mathavi.2007@gmail.com 

CEC (https://swayam.gov.in/explorer?ncCode=CEC) » Programming in Python (course)

Course Assessment-7-2024
outline The due date for submitting this assignment has passed.
Due on 2024-03-31, 23:59 IST.
Week 1 Score: 7/10=70%
(Contents) :
Planning the
Computer Assignment submitted on 2024-03-30, 13:56 IST
Program () 1) What will be the output of the following code? 1 point

Week 2 x=(1,6,7)
(Contents): print(2*x)
Techniques
of Problem (2,12,14)
Solving ()
(1,1,6,6,7,7)
(1, 6, 7, 1, 6, 7)
Week 3
(Contents): Error
Introduction Yes, the answer is correct.
to Python () Score: 1
Accepted Answers:
Week 4 (1, 6, 7, 1, 6, 7)
(Contents):
Conditional 2) Which of the following is correct about a tuple? 1 point
Statements
and Looping
() A tuple can be modified after it is created.
A tuple cannot contain mixed types of data.
Week 5
Elements in a tuple can be accessed using their index.
(Contents):
String Tuples are faster to iterate through than lists because they are mutable.
Manipulation Yes, the answer is correct.
()

S 1

https://onlinecourses.swayam2.ac.in/cec24_cs01/unit?unit=38&assessment=98 1/5
4/23/24, 3:23 AM Programming in Python - - Unit 7 - Week 7 (Content): Introduction to tuples.

Score: 1
Week 6 Accepted Answers:
(Contents): Elements in a tuple can be accessed using their index.
Introduction
to list. () 3) How do you delete a tuple in Python? 1 point

Week 7
(Content): Using the del keyword: del tuple_name
Introduction
to tuples. ()
Using the remove() method: tuple_name.remove()
Lecture 1:
Introduction to
Tuples (unit?
unit=38&lesso Tuples cannot be deleted.
n=39)
Using the pop() method: tuple_name.pop()
Lecture 2:
Tuple No, the answer is incorrect.
operation Score: 0
(unit? Accepted Answers:
unit=38&lesso Using the del keyword: del tuple_name
n=40)

Lecture 3:
Working with 4) What will be the output of the following code? 1 point
Tuples (unit?
unit=38&lesso z=("amar","akbar","anthony")
n=41) print(z[-1:0])

Lecture
("amar")
Material (unit?
unit=38&lesso ("akbar")
n=42) ("anthony")

Quiz: ()
Assessment- Yes, the answer is correct.
7-2024 Score: 1
(assessment? Accepted Answers:
name=98) ()

Week 8
5) Which of the following is a Python tuple? 1 point
(Contents):
Introduction
to
{5,6,7}
dictionaries
()
[5,6,7]

Week 9
(Contents): (5,6,7)
Python
Functions ()
<5,6,7>

Week 10 Yes, the answer is correct.


(Contents) :

S 1

https://onlinecourses.swayam2.ac.in/cec24_cs01/unit?unit=38&assessment=98 2/5
4/23/24, 3:23 AM Programming in Python - - Unit 7 - Week 7 (Content): Introduction to tuples.

Python Score: 1
Modules () Accepted Answers:
(5,6,7)
Week 11
(Contents):
6) Which of the following is the correct way to create a tuple with a single element? 1 point
Input-Output
()

Week 12 my_tuple = (1)


(Contents):
Exception
Handling () my_tuple = 1,

my_tuple = (1,)

my_tuple = {1}

No, the answer is incorrect.


Score: 0
Accepted Answers:
my_tuple = 1,

my_tuple = (1,)

7) Which of the following operations is not supported by tuples in Python? 1 point

Concatenation

Repetition

Modification

Slicing

Yes, the answer is correct.


Score: 1
Accepted Answers:
Modification

8) What will be the output of the following code? 1 point


x1 = (1, 5, 4, 6)
x2 = (1, 2, 3, 4)
print(x1 < x2)

False
True

Y h i

https://onlinecourses.swayam2.ac.in/cec24_cs01/unit?unit=38&assessment=98 3/5
4/23/24, 3:23 AM Programming in Python - - Unit 7 - Week 7 (Content): Introduction to tuples.

Yes, the answer is correct.


Score: 1
Accepted Answers:
False

9) How do you swap the values of two variables a and b in Python using tuple 1 point
unpacking?

a, b = (b, a)

a = b; b = a

(a, b) = b, a

ab=ba

No, the answer is incorrect.


Score: 0
Accepted Answers:
a, b = (b, a)

(a, b) = b, a

10) What will be the output of the following code? 1 point


def my():
return (1, 2), (3, 4)

a, b = my()
print(a)
print(b)

1 2 on one line and 3 4 on the next line.

(1, 2) on one line and (3, 4) on the next line.

((1, 2), (3, 4))

Error

Yes, the answer is correct.


Score: 1
Accepted Answers:
(1, 2) on one line and (3, 4) on the next line.

You were allowed to submit this assignment only once.

https://onlinecourses.swayam2.ac.in/cec24_cs01/unit?unit=38&assessment=98 4/5
4/23/24, 3:23 AM Programming in Python - - Unit 7 - Week 7 (Content): Introduction to tuples.

https://onlinecourses.swayam2.ac.in/cec24_cs01/unit?unit=38&assessment=98 5/5

You might also like