write a python program to display your name using interactive

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



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

 
Code 1
=========================
name = input("Please Enter Your Name : ")
print(f"Welcome {name} !")
 
 
OUTPUT
=========================
 
Please Enter Your Name : Sarah T
Welcome Sarah T !
 
 
 
 
Write a Python Program to Display Your Name Using Interactive using Welcome Message
 

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. 


Code 2
=========================
print("Welcome to World of Programming !!!")
name = input("Please Enter Your Name : ")
print(f"Welcome {name} !")
print("Have a Good Day !")
 
 
OUTPUT
=========================
 
Welcome to World of Programming !!!
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.

Post a Comment

0 Comments