1answer.
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
Darina [25.2K]
3 years ago
10

Write a program that reads a person's first and last names separated by a space, assuming the first and last names are both sing

le words. Then the program outputs last name, comma, first name. End with newline. Example output if the input is: Maya Jones Jones, Maya
Computers and Technology
1 answer:
Over [174]3 years ago
3 0

Answer:

Written in Python:

import re

name = input("Name: ")

print(re.sub("[ ]", ", ", name))

Explanation:

This line imports the regular expression library

import re

This line prompts user for input

name = input("Name: ")

This line replace the space with comma and prints the output

print(re.sub("[ ]", ", ", name))

You might be interested in
Water is constantly in motion.<br> True or false
motikmotik

Answer: true

Explanation: yes water is constantly in motion

7 0
2 years ago
An exclusion contract A. gives a firm the right to be the exclusive provider of a good in a particular market. B. is a form of e
irina1246 [14]

Answer:

D. All of the above

7 0
3 years ago
Easy 25 points answer what is it called that you use only 1 and 0 like this 1010010011001100011110001010010101001010101010010101
Arlecino [84]
Binary. Is the correct answe
3 0
3 years ago
A recursive method may call other methods, including calling itself. Creating a recursive method can be accomplished in two step
liq [111]

Answer:

Explanation:

The following code is written in Java. It creates the raiseToPower method that takes in two int parameters. It then uses recursion to calculate the value of the first parameter raised to the power of the second parameter. Three test cases have been provided in the main method of the program and the output can be seen in the attached image below.

class Brainly {

   public static void main(String[] args) {

       System.out.println("Base 5, Exponent 3: " + raiseToPower(5,3));

       System.out.println("Base 2, Exponent 7: " + raiseToPower(2,7));

       System.out.println("Base 5, Exponent 9: " + raiseToPower(5,9));

   }

   public static int raiseToPower(int base, int exponent) {

       if (exponent == 0) {

           return 1;

       } else if (exponent == 1) {

           return base;

       } else {

           return (base * raiseToPower(base, exponent-1));

       }

   }

 

}

4 0
2 years ago
Why do employers prefer to hire people with more work ethic?
Andrej [43]

The importance of a good work ethic in school and life. Your good work ethic tells future employers what they might expect from you on the job.

4 0
2 years ago
Other questions:
  • Fundamental types of data, such as strings, integers, and real numbers, are known as
    5·1 answer
  • After Maya gave her friend the password to a protected website, the friend was able to remember it only long enough to type it i
    6·1 answer
  • Which stage of the waterfall model is most like the simple model's stage 5?
    12·1 answer
  • If you've finished working with a data file but intend to work on it again during your work session, which button would you use
    10·2 answers
  • With a(n) ______, a search engine will show ads that have the keyword typed exactly as the searcher used, but may also have othe
    6·1 answer
  • How would you describe the difference between a syntax error and a logic error?
    13·2 answers
  • Most presentation programs allow you to save presentations so they can be viewed online by saving them as ____
    5·2 answers
  • Dash transfers several bits of data together at one time<br>​
    6·1 answer
  • Define a function below, filter_out_strs, which takes a single argument of type list. Complete the function so that it returns a
    10·1 answer
  • Why is my internet slow even though the speed test says it is fast
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!