Coding Quiz
The first coding quiz requires writing a function that outputs ten times the given number.
This program takes an integer input, multiplies it by ten, and returns the result.
def solution(number): return # Write your code here
Hint
-
defis a keyword used to define a function — a block of code that performs a specific task. -
returnis a keyword that sends back the result of the function to the caller. -
To multiply the input by 10 and return the result, use the multiplication operator
*like this: returnnumber * 10
Using what you've learned so far, write a function that takes a number, multiplies it by 10, and returns the result.
Try running your code to check if it passes the test cases.
Then, click the Solution button at the bottom right to view the correct answer.
Input and Output Examples
-
Input:
16 -
Output:
160
-
Input:
3 -
Output:
30
Lessons in this chapter · Master the Fundamentals of Python
- 1. What is Programming and What Benefits Can You Gain from Learning It?
- 2. Coding and Viewing Your Results in Real-Time
- 3. Are There Levels in Programming Languages?
- 4. Features of Python and Simple Code Example
- 5. Reasons Why Python is Popular
- 6. Why is Indentation Important in Python?
- 7. Printing Output in Python
- 8. Getting User Input in Python
- 9. Multiple-choice quiz
- 10. Statements and Expressions
- 11. Predefined Reserved Words in Python - Keywords
- 12. How to Name Variables and Functions Sensibly
- 13. Explaining Code with Comments
- 14. What are Identifiers?
- 15. A Container for Data, Variables
- 16. Important Points When Assigning Values to Variables
- 17. Symbols for Performing Operations, Operators
- 18. Literals Representing Data
- 19. Coding Quiz - Return 10 Times the Given Number
- 20. Multiple-choice quiz
- 21. Fill-in-the-blank quiz
Lecture
AI Tutor
Design
Upload
Notes
Favorites
Help