Coding Quiz
The first coding quiz involves writing a function that outputs ten times the given number.
This is a simple program where you take an integer input from the user, calculate ten times that integer, and output the result.
def solution(number): return # Write your code here
Hint
-
def
is a keyword used to define a block of code that performs a particular task, known as a function. -
return
is a keyword used to return the result of a function. The value following return is the result of the function. -
To return ten times the given number (number), you need to write the product of number and 10 next to return. In Python, the multiplication operation is performed using the
*
operator.
Using what you've learned so far, write a function that outputs ten times the input number, and ensure it passes the test.
Press the Solution
button at the bottom right to see an example of the function written.
Input and Output Examples
-
Input:
16
-
Output:
160
-
Input:
3
-
Output:
30
Guidelines
AI Tutor
Publish
Design
Upload
Notes
Favorites
Help