2018年1月8日 星期一

Python: Generate a list and tuple with comma-separated numbers

Python: Generate a list and tuple with comma-separated numbers

Python Basic: Exercise-8 with Solution

Write a Python program to display the first and last colors from the following list.
color_list = ["Red","Green","White" ,"Black"]
Sample Solution:-
color_list = ["Red","Green","White" ,"Black"]
print( "%s %s"%(color_list[0],color_list[-1]))
=========== RESTART: F:/Python_APSC/py-ex-basic-8.py ==========
Red Black
>>> 

沒有留言:

張貼留言

ESP32 MQTT – Publish DHT11/DHT22 Temperature and Humidity Readings (Arduino IDE)

  ESP32 MQTT – Publish DHT11/DHT22 Temperature and Humidity Readings (Arduino IDE) Arduino程式 #include " DHT.h " #include < Wi...