Program to display numbers from a list

In this program, we will display numbers from a list.

Steps to solve the program
  1. Take a list as input.
  2. Use for loop to iterate over each element of the list.
  3. Print the output.
				
					list1 = [1,5,8,0,4]
for val in list1:
    print(val,end=" ")
				
			

Output :

				
					1 5 8 0 4 
				
			

first 20 natural numbers using for loop

print each word in a string on a new line

Leave a Comment