In this article let's try to learn how to print your name interactively using python. In this Python program you have to ask a user to enter a name so that it is of string format. once the user enters a string so you have to print a welcome message and directly print your name.
Write a Python Program to Display Your Name Using Interactive
In order to ask the user to enter rename select user input function call and use name as a variable to store string. once the user enters the name so let's try to print it using a print function call
Welcome Sarah T !
You can also make the program more interactive by welcoming the user welcome message and then asking a user to enter his name. and then finally printing it using a print function.
name = input("Please Enter Your Name : ")
print(f"Welcome {name} !")
print("Have a Good Day !")
Please Enter Your Name : James
Welcome James !
Have a Good Day !
Conclusion : Try to execute this program by yourself by providing the name and comment down below the output.Let me know which code you used the most.
0 Comments