Lecture
Coding Quiz - Output Formatting
The provided solution function takes name and message as parameters.
The function should return a single string combining the given name and message.
The output format is {message}, {name}. For example, if you pass "CodeFriends" as the name and "Nice to meet you" as the message to the function, it should return "Nice to meet you, CodeFriends".
Parameter Format
def solution(name, message): return # Write your code here
Constraints
-
The
nameparameter is a string. -
The
messageparameter is a string.
Example Input and Output
- Input:
name = "Alex",message = "Nice to meet you" - Output:
"Nice to meet you, Alex"
Lessons in this chapter Β· Functions: Code Blocks for Specific Tasks
- 1. Creating Reusable Code Blocks with Functions
- 2. The Difference Between Parameters and Arguments
- 3. Handling TypeError for Function Parameters
- 4. Multiple-choice quiz
- 5. Understanding and Using Variable-Length Arguments
- 6. How to Assign Default Values to Function Parameters
- 7. Using Keyword Arguments
- 8. Various Function Return Methods
- 9. Coding Quiz - Output Formatting
- 10. Multiple-choice quiz
- 11. Fill-in-the-blank quiz
Lecture
AI Tutor
Design
Upload
Notes
Favorites
Help