You can use this assignment in your class!
Mastery Progress(100.0%)
i

Unit 3: Types - Review Assignment

Write a function that takes in two parameters, first_name and last_name, and returns a formatted string of the format "<first_name> <last_name>".

You answeredJUST NOW
Python
def formatted_name(first_name, last_name):
# Your code here
# Input handling - do not modify!
print(formatted_name(input(), input()))
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
You passed all test cases!
STDIN
Alec
Kretch
Expected STDOUT
Alec Kretch
Your STDOUT
Alec Kretch
STDIN
John
Johnson
Expected STDOUT
John Johnson
Your STDOUT
John Johnson
STDIN
Jane
Doe
Expected STDOUT
Jane Doe
Your STDOUT
Jane Doe

Did you like this question?

(Voting helps us personalize your learning experience!)
imgInstructor solution
Alec KretchNOV 17, 2022, 5:01:25 PM
Python
def formatted_name(first_name, last_name):
return first_name + " " + last_name
# return "%s %s" % (first_name, last_name) # This would also work
# Input handling - do not modify!
print(formatted_name(input(), input()))
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Was this helpful?

(Voting helps us personalize your learning experience!)
img3.2 Strings - Lesson

Concatenation

Similar to how we can perform different operations on ints (i.e., math), we can perform various operations on strings!

One common operation is known as 'concatenation'. This means combining multiple strings into one, and it can be done in Python via the + operator, as such:

Was this helpful?

(Voting helps us personalize your learning experience!)
Think you've got it?

When used with ints, the + operator performs addition (i.e., a = 1 + 15). When used with strings, the + operator performs ____ (i.e., a = "Open" + "Class").

  • Short answer field
Submit answer

Was this helpful?

(Voting helps us personalize your learning experience!)

You may exit out of this review and return later without penalty.