answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
leonid [27]
2 years ago
15

Write a program that asks the user to enter a name, and then prints

Computers and Technology
2 answers:
Digiron [165]2 years ago
6 0

Answer:

user_name = input("Please enter a name or type Nope to terminate the program: ")

while( user_name != "Nope" ):

   print("Nice to meet you ", user_name )

   user_name = input("Please enter a name or type Nope to terminate the program: ")

Explanation:

Get the name from user as an input and store it in the user_name variable.

Run a while loop until user_name is not equal to the value of Nope.

Inside the while loop, display the name of user and repeat the question until user types Nope.

Amanda [17]2 years ago
6 0

Answer:

while True:

   your_name = input('Please Enter Your Name: ')

   if your_name == 'Nope':

       break

   print('Welcome to My Page {}'.format(your_name))

Explanation:

This program will print the name unless name is Nope. Please do make sure indentation is mentained.

Result

Please Enter Your Name: Joe

Welcome to My Page Joe

Please Enter Your Name: Nick

Welcome to My Page Nick

Please Enter Your Name: Rose

Welcome to My Page Rose

Please Enter Your Name: Nope

You might be interested in
Fill in the blanks to make the print_prime_factors function print all the prime factors of a number prime factor is a number tha
fomenos

The answer & explanation for this question is given in the attachment below.

3 0
2 years ago
Modify the sentence-generator program of Case Study so that it inputs its vocabulary from a set of text files at startup. The fi
Snezhnost [94]

Answer:

Go to explaination for the program code.

Explanation:

Before running the program you need to have these files created like below in your unix box.

Unix Terminal> cat nouns.txt

BOY

GIRL

BAT

BALL

Unix Terminal> cat articles.txt

A

THE

Unix Terminal> cat verbs.txt

HIT

SAW

LIKED

Unix Terminal> cat prepositions.txt

WITH

BY

Unix Terminal>

Code:

#!/usr/local/bin/python3

import random

def getWords(filename):

fp = open(filename)

temp_list = list()

for each_line in fp:

each_line = each_line.strip()

temp_list.append(each_line)

words = tuple(temp_list)

fp.close()

return words

articles = getWords('articles.txt')

nouns = getWords('nouns.txt')

verbs = getWords('verbs.txt')

prepositions = getWords('prepositions.txt')

def sentence():

return nounPhrase() + " " + verbPhrase()

def nounPhrase():

return random.choice(articles) + " " + random.choice(nouns)

def verbPhrase():

return random.choice(verbs) + " " + nounPhrase() + " " + prepositionalPhrase()

def prepositionalPhrase():

return random.choice(prepositions) + " " + nounPhrase()

def main():

number = int(input('Enter number of sentences: '))

for count in range(number):

print(sentence())

if __name__=='__main__':

main()

kindly check attachment for code output and onscreen code.

6 0
2 years ago
Type the correct answer in the box. Spell all words correctly.
kvasek [131]

Answer:

Presentations?

Explanation:

6 0
2 years ago
What is retrieved from a search containing two terms separated<br> by the AND operator?
egoroff_w [7]

Answer:

A AND B= 1 or 0

1 1  1

0 1  0

1 0  0

0 0 0

So, as explained above if both are 1 we then only get 1, or else we get 0 always in case of AND which is a logical operator, whose output can be 0 or 1 only. This is being depicted above.

Explanation:

If both are 1 we get 1 or always else, we get the output =0.

8 0
2 years ago
Effective character encoding requires:
lidiya [134]

To answer your question the answer would be B compatible browsers

4 0
2 years ago
Other questions:
  • which of these paste options is commonly available from the paste options button? A&gt; use the destination them. B. keep the em
    14·2 answers
  • Let's assume that the smallest possible message is 64 bytes (including the 33-byte overhead). if we use 100base-t, how long (in
    10·1 answer
  • Ben's team is working on an English project. The members want to see everyone's progress on their part of the project. What tech
    7·2 answers
  • Isabel is creating a wireframe. She has drawn a layout for the home page along with outlining the navigation elements. She now w
    15·2 answers
  • "Suppose there is a class Alarm. Alarm has two class variables, code which contains a String value representing the code that de
    10·1 answer
  • Consider the following relationship involving two entities, students and classes:A student can take many classes. A class can be
    9·1 answer
  • Write a generator function named count_seq that doesn't take any parameters and generates a sequence that starts like this: 2, 1
    5·1 answer
  • Which of the following methods could be considered a "best practice" in terms of informing respondents how their answers to an o
    7·1 answer
  • 9.6 Code Practice: Question 1
    9·1 answer
  • Discussion Question 10: A bank in California has 13 branches spread throughout northern California , each with its own minicompu
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!