Robotics & Artificial Intelligence

Write a Python program to declare and print 'list', 'dictionary', and 'tuple'.

Getting Started

3 Likes

Answer

# Declaring a list
my_list = [10, 20, 30, 40]
print("List:", my_list)

# Declaring a dictionary
my_dict = {"Name": "Amit", "Age": 15, "City": "Delhi"}
print("Dictionary:", my_dict)

# Declaring a tuple
my_tuple = (5, 10, 15, 20)
print("Tuple:", my_tuple)

Output

List: [10, 20, 30, 40]
Dictionary: {'Name': 'Amit', 'Age': 15, 'City': 'Delhi'}
Tuple: (5, 10, 15, 20)

Answered By

1 Like


Related Questions