Write a program that asks the user to enter a name, and then print "Nice to meet you NAME". Your program should repeat these steps until the user inputs "Nope".
need this in python plz.
Answers
Answered by
1
Code:-
while True:
name = str(input("Enter name : "))
if name == "Nope" or name == "nope":
break
else:
print("Nice to meet you, " + name)
Answered by
1
Python program to greet a user.
Program:
x=str(input("Enter your name : "))
while(x!="No"):
print("Nice to meet you,",x)
x=str(input("Enter your name : "))
Input (plain text) and output (bolded text):
Enter your name : Harika
Nice to meet you, Harika
Enter your name : Abhimanyu
Nice to meet you, Abhimanyu
Enter your name : Rishi
Nice to meet you, Rishi
Enter your name : Pallavi
Nice to meet you, Pallavi
Enter your name : No
#Stopped.
Explanation :
- First take an input from user into a variable that stores a name.
- Then write a while loop stating the condition that it should run till name is allocated with "No".
- Enter the loop, print the greeting and again take the input, this time, within the loop.
- Repeat this process till the user inputs 'No' that leads to the termination of the loop.
Learn more :
1) What is python programming?
https://brainly.in/question/8474677
2) Python program to make a calculator.
https://brainly.in/question/14752569
Attachments:
Similar questions