You are here: Home / Topics / Python program to display the first and last colors from the following list

Python program to display the first and last colors from the following list

Filed under: Python on 2023-09-18 06:57:02

color_list = ["Red","Green","White" ,"Black"]

color_list = ["Red","Green","White" ,"Black"]
print( "%s %s"%(color_list[0],color_list[-1]))     

Output:

Red Black 


About Author:
M
Mr. Dubey     View Profile
Founder of MCQ Buddy. I just like to help others. This portal helps students in getting study material free. Share your stuff here so that others can get benefitted.