Lab cycle4

 

Exercise 4:

Write a program that asks the user for their name and how many times to print it. The program should print out the user’s name the specified number of times.


Source code:


name=input("Enter your name")

n=int(input("How many  number of times to print"))

for i in range(n):

    print("Your name is",name) 



RESULT:

Enter your name sai

How many  number of times to print 5

Your name is sai

Your name is sai

Your name is sai

Your name is sai

Your name is sai


Comments

Popular posts from this blog

NOTE