Practice Functions (11.9) - Python Programming - CBSE 11 AI (Artificial Intelligence)
Students

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

Functions

Practice - Functions

Enroll to start learning

You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

What is the keyword used to define a function in Python?

💡 Hint: Think of how you say you are defining something in Python.

Question 2 Easy

Write a simple function add(a, b) that adds two numbers.

💡 Hint: Use the return keyword to send back a value.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What is the purpose of a function in Python?

To define a variable
To create reusable code
To take user input

💡 Hint: Think about how functions can help avoid writing the same code twice.

Question 2

True or False: A function can return more than one value.

True
False

💡 Hint: Consider using a tuple when you need to return multiple results.

3 more questions available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Write a function is_prime(num) that checks if a number is prime. Return True if it is, and False otherwise.

💡 Hint: Consider how prime numbers are defined.

Challenge 2 Hard

Create a function fibonacci(n) that returns a list of the first n Fibonacci numbers.

💡 Hint: Recall how the Fibonacci sequence works.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.