[Edhesive] 4.1 Code Practice
Write a program that asks the user to enter a name, and then prints Nice to meet you NAME. Your program should repeat these steps until the user inputs Nope.

Sample Run:

Please enter a name: (Nope to end) Antonio
Nice to meet you Antonio
Please enter a name: (Nope to end) Jonathan
Nice to meet you Jonathan
Please enter a name: (Nope to end) Tyler
Nice to meet you Tyler
Please enter a name: (Nope to end) Brianne
Nice to meet you Brianne
Please enter a name: (Nope to end) Nope

Edhesive 41 Code Practice Write a program that asks the user to enter a name and then prints Nice to meet you NAME Your program should repeat these steps until class=

Respuesta :

Answer:

name = input("Enter a name, type Nope to end loop: ")

while (name != "Nope"):

   print("Nice to meet you " + name)

   name = input("Enter a name, type Nope to end loop: ")

   

   print("Done")

Explanation:

It works on python/Edhesive perfectly!

Following are the Python program to an input string value and print value with the message:

Program Explanation:

  • Defining the while loop that runs condition is true.
  • Defining a variable "user_name" that uses the input method to input value from the user-end.
  • After input value the if conditional block is used that checks input value is equal to "Nope" when the condition is true it uses the break keyword and print values with the message.

Program:

while True:#defining loop that runs when condition is true

   user_name = input('Enter your name:(Nope to end): ')#defining a variable user_name that input value

   if user_name == 'Nope':#defining if block that checks input string value equal to Nope  

       break#using break keyword

   print('Nice to meet you {}'.format(user_name))#print message

Output:

Please find the attachment.

Learn more:

brainly.com/question/18502091

Ver imagen codiepienagoya