MSK Technologies

Home
Programs
Programs List
Pages
Python Java Material PLSQL Material
Search A Job

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

  1. Home
  2. Programs
  3. Program - 6
Write a Python program to display the first and last colors from the following list.
color_list = ["Red","Green","White" ,"Black"]

Program


def myfun():
    colors_list = ["Red", "Green", "White", "Black"]
    print("%s %s" % (colors_list[0], colors_list[-1]))
      
if __name__=="__main__":      
    myfun()

Output:

Red Black


More Questions


6 . Write a Python program to display the first and last colors from the following list.
7 . Write a Python program that accepts an integer (n) and computes the value of n+nn+nnn.
8 . Write a Python program that prints the calendar for a given month and year.
9 . Write a Python program to calculate the number of days between two dates.
10 . Write a Python program to get the volume of a sphere with radius six.
11 . Write a Python program to calculate the sum of three given numbers. If the values are equal, return three times their sum.
12 . Write a Python program to count the number 4 in a given list.
13 . Write a Python program to get n (non-negative integer) copies of the first 2 characters of a given string. Return n copies of the whole string if the length is less than 2.
14 . Write a Python program to test whether a passed letter is a vowel or not.
15 . Write a Python program that checks whether a specified value is contained within a group of values.
16 . Write a Python program that concatenates all elements in a list into a string and returns it.



For latest job updates join Telegram Channel: https://t.me/sateeshm

Programs

Apply For The Job

Apply For Job

Java Material

Python Material

PLSQL Material

.Net Material

Practice Programs

Write a Python Program to Check Leap Year.

Write a Python program that prints the calendar for a given month and year.

Write a python program to find absolute value of a number in the list

Write a Python Program to find sum of array.

Write a python program to checking internet speed

Courses
Java Python PLSQL .Net ADO.Net About Us
Quick Links
Daily Use English Sentences Daily General Knowledge General Knowledge Latest Update Inventions and Inventors జనరల్ నాలెడ్జ్ General Knowledge Spoken English Spoken Hindi GK Hindi Telugu Facts Unknown Facts Psychology Facts Motivation Quotes విటమిన్ - సి,డి,ఇ,కె Android
Spiritual
రాధాకృష్ణ భగవద్గీత Motivation Quotes Slokas Talapatra Nidhi ఆధ్యాత్మిక భక్తి ప్రపంచం Sadhguru Sai Motivation Quotes గౌతమ బుద్ధుడు Bhagavad Gita Quotes
Newsletter

Dolor amet sit justo amet elitr clita ipsum elitr est.

© sateeshm, All Right Reserved. Designed By sateeshm
Home Help FQAs