Lecture

Coding Quiz

The first coding quiz involves writing a function that outputs 10 times the given number.

This is a simple program that takes one integer input from the user, calculates 10 times that number, and outputs the result.

Output 10 Times the Given Number
def solution(number): return # Write your code here

Hint

  • def is a keyword used to define a function, which is a block of code that performs a specific task.

  • return is a keyword used to return the result of a function. The value following return will be the function's output.

  • To return 10 times the given number (number), write an expression that multiplies number by 10 next to return. In Python, multiplication is performed using the * operator.

Based on what you've learned so far, write a function that outputs 10 times the input number and check if it passes the tests.

Click the Sample Answer button in the bottom-right corner to see an example of how to write the function.




Input and Output Examples

  • Input: 16

  • Output: 160

  • Input: 3

  • Output: 30

Lecture

AI Tutor

Publish

Design

Upload

Notes

Favorites

Help