0% found this document useful (1 vote)
109 views

Introduction To Python Assignment: Problem Statement

Sam has been invited to give an introductory presentation on Python. As part of the presentation, he will demonstrate how to: 1) Create tuples, concatenate them, repeat elements, and access specific elements. 2) Create a list containing tuples of different data types and append new tuples and lists to the list. 3) Create a dictionary containing keys mapped to values of different data types and extract keys and values. 4) Create a set containing duplicate values and print the result.

Uploaded by

Its-me -Sravs
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
109 views

Introduction To Python Assignment: Problem Statement

Sam has been invited to give an introductory presentation on Python. As part of the presentation, he will demonstrate how to: 1) Create tuples, concatenate them, repeat elements, and access specific elements. 2) Create a list containing tuples of different data types and append new tuples and lists to the list. 3) Create a dictionary containing keys mapped to values of different data types and extract keys and values. 4) Create a set containing duplicate values and print the result.

Uploaded by

Its-me -Sravs
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Python Certification Foundation Course

Introduction to Python Assignment

Problem Statement:

Consider yourself to be Sam who is a data scientist. He has been invited as a guest lecturer at a college
to take an introductory session on Python.

Tasks to be performed:

1. Create 1st tuple with values -> (10,20,30), 2nd tuple with values -> (40,50,60).
a. Concatenate the two tuples and store it in “t_combine”
b. Repeat the elements of “t_combine” 3 times
c. Access the 3rd element from “t_combine”
d. Access the first three elements from “t_combine”
e. Access the last three elements from “t_combine”
2. Create a list ‘my_list’ with these elements:
a. First element is a tuple with values 1,2,3
b. Second element is a tuple with values “a”,”b”,”c”
c. Third element is a tuple with values True,False
3. Append a new tuple – (1,’a’,True) to ‘my_list’
a. Append a new list – [“sparta”,123] to my_list
4. Create a dictionary ‘fruit’ where:
a. The first key is ‘Fruit’ and the values are (“Apple”,”Banana”,”Mango”,”Guava”)
b. The second key is ‘Cost’ and the values are (85,54,120,70)
c. Extract all the keys from ‘fruit’
d. Extract all the values from ‘fruit’
5. Crete a set named ‘my_set’ with values (1,1,”a”,”a”,True,True) and print the result

Intellipaat Software Solutions Pvt. Ltd. Copyright 2011-2020. All Rights Reserved

You might also like