Sharpen your python coding skills by solving these mathematical problems and puzzles.
There are currently 38 quizzes on this page, which are aimed at nurturing various levels of python programming skills.
Check out the python tutorials.
Each quiz asks the student to write a single python function. If the student needs to define more than one function, then one function must be defined as the main function, while the others must be defined inside the main function (inner functions).
These quizzes are accompanied with their solutions. Check them out if you want to warm up before attempting the quizzes in Level 1 and up.
A function that adds up two numbers
A function that calculates the square of integers after reading them from a file
A function that calculates the square of integers after reading them from a file, with validation
A function that adds up two integers after reading them from a file
A calculator function
A function that returns the length of a string
A function that counts the number of "a" characters in a string
These quizzes test the student's understanding of the following concepts in python: numeric and string data types, and control statements, particularly the for loop.
Solve a linear equation
Solve a linear equation
Counting digits
Inspect the last two digits
Where is that letter?
These quizzes enhance the student's understanding of for and while loops, and challenge them to apply complex conditional statements within the loops.
A calculator function that reads input from a file
A calculator function that performs a sequence of calculations from a file
Consecutive pairs of digits
Prime number test
Summing a sequence of positive numbers
Summing a sequence of negative numbers
Counting occurrence of digits
Count the number of vowels
Count the number of vowels in a string read from a file
I think of a number
Counting occurrence of digits
Counting occurrence of digits by reading from a file
These quizzes train the students on a deep understanding of iterative and conditional statements, and to apply these programming concepts to solve complex mathematical tasks.
Counting occurrence of digits
Calculate the average
Count the number of factors
Count prime numbers
These quizzes train the students to apply their understanding of functions, conditional and iterative statements, and collection data types to solve complex mathematical problems.
Continued fractions
The 3k+1 recurrence puzzle
Largest number with a given number of factors
Perfect numbers
Simple encryption
Numerical integration: the rectangular method
Parasitic numbers
More parasitic numbers
The sum of prime factor indices
Is this decimal recurring?