Please answer the ques in python with showing the answer ( THERE is only 1 ques in 2 steps) Step 1: Given this list of instruments: 'guitar', 'piano', 'violin' Write python program including a for loop to match the output below Output: I love to play the guitar! I love to play the piano! I love to play the violin! Music rocks! Step 2: Use a list comprehension with the range() function to create list of the multiples of 5 from 1 to 10 inclusive. Use a loop to print the numbers in your list horizontally separated by spaces. On a separate line compute and print the sum of those numbers Output: 5 10 15 20 25 30 35 40 45 50 275
Please answer the ques in python with showing the answer ( THERE is only 1 ques in 2 steps)
Step 1:
Given this list of instruments: 'guitar', 'piano', 'violin'
Write python program including a for loop to match the output below
Output:
I love to play the guitar!
I love to play the piano!
I love to play the violin!
Music rocks!
Step 2:
Use a list comprehension with the range() function to create list of the multiples of 5 from 1 to 10 inclusive. Use a loop to print the numbers in your list horizontally separated by spaces. On a separate line compute and print the sum of those numbers
Output:
5 10 15 20 25 30 35 40 45 50
275
python introduction:-
Python is a versatile scripting language that is widely used in many different contexts, such as system administration, web development, scientific computing, and artificial intelligence. Python is very easy to learn due to its clear syntax and readability.
Step by step
Solved in 3 steps with 2 images