Question

Write a function full_name(first_name, last_name) that takes a person's first name and last name as parameters...

Write a function full_name(first_name, last_name) that takes a person's first name and last name as parameters and returns their full name made up of the first name, a space character and their last name all concatenated together. For example: Test Result name = full_name('Alex', 'Ng') print(name) Alex Ng print(full_name('Malcolm', 'X')) Malcolm X

0 0
Add a comment Improve this question Transcribed image text
Answer #1
def full_name(first_name, last_name):
    return first_name + ' ' + last_name


# Testing the function here. ignore/remove the code below if not required
name = full_name('Alex', 'Ng')
print(name)
print(full_name('Malcolm', 'X'))

Alex Ng Malcolm X Process finished with exit code o

Add a comment
Know the answer?
Add Answer to:
Write a function full_name(first_name, last_name) that takes a person's first name and last name as parameters...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In python,write a function nameSet(first, last) that takes a person's first and last names as input,...

    In python,write a function nameSet(first, last) that takes a person's first and last names as input, and returns a tuple of three strings: the first string gives the union of all letters in the first and last names (no duplication though). The second string gives the intersection of letters in the first and last names, i.e. the common letters. If there are no common letters, then the second string is empty (''). The third string gives the symmetric difference between...

  • Write a program that does the following in Python Code: Stores the following three lists: last_name...

    Write a program that does the following in Python Code: Stores the following three lists: last_name = ["Smith", "Jones", "Williams", "Bailey", "Rogers", "Pyle", "Rossington"] first_name =["Lisa", "Bill", "Jay", "Sally", "Walter","Jake","Gary"] phone_number =["240-233-1921", "301-394-2745", "571-321-8934", "703-238-3432", "703-947-9987", "301-945-3593", "240-671-3221"] Has a function named combine_lists() that takes in last_names, first_names and phone_numbers as lists and returns a dictionary called phone_book that uses last_name as the key and a list consisting of first_name and phone_number. Has a main function that iterates through the...

  • Python Function Name: unscramble Parameters: a string Returns: a string Description: Write a function, unscramble, that...

    Python Function Name: unscramble Parameters: a string Returns: a string Description: Write a function, unscramble, that takes an input string, and returns a the unscrambled version of the argument. To unscramble the string: When the string has an odd number of characters, middle character is the first character in the unscrambled result Pairs of remaining characters are added to the result, proceeding left to right from inner-most to outer-most characters. Example Call: unscramble('3cis1') Expected result: ics31 Example Call: unscramble('ocicssol') Expected...

  • Write a C++ function, smallestIndex, that takes as parameters an int array and its size and...

    Write a C++ function, smallestIndex, that takes as parameters an int array and its size and returns the index of the first occurrence of the smallest element in the array. To test your function, write a main that prompts a user for a list of 15 integers and outputs the index and value of the first occurrence of the smallest value. The program should print out Enter 15 integers: The position of the first occurrence of the smallest element in...

  • Can you write a function that takes 2 vectors as parameters and returns a larger vector...

    Can you write a function that takes 2 vectors as parameters and returns a larger vector containing the two vectors Example Vector a: 1 2 3 4 5 Vector b: 6 7 8 9 10 Concatenated vector: 1 2 3 4 5 6 7 8 9 10

  • More Practice: Writing Lists& Strings . Write a function average_ evens that takes a list of...

    More Practice: Writing Lists& Strings . Write a function average_ evens that takes a list of numbers as parameters, and adds all the even numbers together and returns their average using a list Example function call: print (average_evens (I-2, -3, 4, 0, 1, 2,3 Outputs: 0 Write a function match that takes two strings as a parameter and returns how many letters the strings have in common. You should treat upper and lower case letters as the same letter ('A,...

  • Write a program that reads a person's first and last names, separated by a space. Then...

    Write a program that reads a person's first and last names, separated by a space. Then the program outputs last name, comma, first name. End with newline. Example output if the input is: Maya Jones Jones, Maya import java.util.Scanner; public class SpaceReplace {    public static void main (String [] args) {       Scanner scnr = new Scanner(System.in);       String firstName;       String lastName; //answer goes here//    } }

  • Write a C++ function, lastLargestIndex that takes as parameters an int array and its size and...

    Write a C++ function, lastLargestIndex that takes as parameters an int array and its size and returns the index of the "last occurrence" of the largest element in the array. Include another function to print the array. Also, write a program to test your function. [HINTS) Create an array of size 15 in the main function and initialize it with the values shown in the below sample output. Pass the array and its size to function lastLargestindex; function lastLargestindex returns...

  • Using C Programming, Write a program that prompts for the user's first and last names. Declare a third array that will hold the user's last name and first name, separated by a comma and space....

    Using C Programming, Write a program that prompts for the user's first and last names. Declare a third array that will hold the user's last name and first name, separated by a comma and space. Use loops to inter through the names one character at a time, storing them into the full name array. Don't forget about the terminating character. Sample run: Enter your first name: john Enter your last name: matthews First name: John Last name: Matthews Full name:...

  • Using C++, thanks! Write a function called printAsterisks) that takes in no parameters nor returns any...

    Using C++, thanks! Write a function called printAsterisks) that takes in no parameters nor returns any value, but prints 3 rows of 4 Asterisks each. HINT: Use nested loops.:) For example: Test printAsterisks ); Result Answer: (penalty regime: 0 %) 1 |Void prinAsterisks() 4

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT