Professional Documents
Culture Documents
Rony Sheth 23ibm152
Rony Sheth 23ibm152
Rony Sheth 23ibm152
1 Define a empty list named Country_list and write the program to add the following countries one by
one. “India”, “Germany”, “Bangladesh”, “Sri-Lanka”, “Kuwait”, “Brazil”, “USA”, “UK”
Q2)Perform the following questions on the Country_list defined above and display code of each
c) Use the slice function to get a list of [Sri-lanka, Kuwait, Brazil, USA]
d) Show the list of Country_list[0:6:2]
Output:
Q7) Program to populate tuple with name of Ocean_tuple by user-entered items as given below.
“Electrical_eel”, “Jelly_fish”, “shrimp”, “Turtles”,”blue_whale”
Q8) Write a program to display whether the item is fish or not in the Ocean_tuple generated in the
above question using for loop. (E.g. The “Jelly_fish” is a fish.)
Q9 ) Write a program to show the index of each of the items in the Ocean_tuple using a while loop.