Practice Week-02 (10.2) - Examples - Data Structures and Algorithms in Python
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

Week-02

Practice - Week-02

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

List all factors of 12 using Python.

💡 Hint: Remember to iterate from 1 to 12.

Question 2 Easy

Is 9 a prime number? Explain your answer.

💡 Hint: Consider the definition of prime.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What is the range of factors for a number n?

1 to n
0 to n
1 to n-1

💡 Hint: Think about where you would start checking for factors.

Question 2

True or False: 1 is considered a prime number.

True
False

💡 Hint: Recall how we defined prime numbers.

2 more questions available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Given a number n, create a Python function to return all the numbers less than n that are prime. Optimize the function to reduce time complexity.

💡 Hint: Consider starting with an array that marks all numbers as potential primes.

Challenge 2 Hard

Propose an algorithm that not only checks for prime numbers but efficiently counts the prime factors for any given number x.

💡 Hint: You already have a factors function. Think about how to integrate a counting feature.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.