Welcome to a collection of fundamental Python programming challenges! These exercises are designed to help you practice and improve your Python programming skills. Each challenge comes with a brief description and a code snippet to get you started.
-
Factorial Find and display the factorial of a given number.
-
Even or Odd Check if a number is even or odd.
Check if a number is prime.
Find and display the largest among three numbers.
Find and display the smallest among three numbers.
Calculate and display the square root of a number.
Calculate and display the result of a^b.
Find and display the sum of all even numbers between 1 and N.
Find and display the sum of all odd numbers between 1 and N.
Calculate and display the average of N numbers.
Find and display the GCD of two numbers.
Find and display the LCM of two numbers.
Reverse and display a given string.
Check if a string is a palindrome.
Count and display the number of vowels and consonants in a string.
Convert a lowercase string to uppercase.
Convert an uppercase string to lowercase.
Calculate and display the length of a string.
Concatenate two strings.
Check if a string contains a specific substring.
Remove spaces from a string.
Count the number of words in a string.
Find and display the largest element in a list.
Find and display the smallest element in a list.
Calculate and display the sum of all elements in a list.
Calculate and display the average of elements in a list.
Search for an element in a list.
Sort a list in ascending order.
Sort a list in descending order.
Find and display the second largest element in a list.
Find and display the second smallest element in a list.
Generate and display the Fibonacci series up to N terms.
Implement a binary search algorithm for a sorted list.
Calculate and display the area of a triangle given its base and height.
- Circle Area Calculate and display the area of a circle given its radius.
Calculate and display the area of a rectangle given its length and width.
Calculate and display the area of a square given its side length.
Convert a decimal number to binary.
Convert a binary number to decimal.
Convert a decimal number to hexadecimal.
Convert a hexadecimal number to decimal.
Calculate and display the sum of digits of a number.
Calculate and display the product of digits of a number.
Check if a number is a palindrome.
Find and display the prime factors of a number.
Implement a simple calculator (addition, subtraction, multiplication, division).
Generate the first N prime numbers.
Feel free to pick any challenge that interests you and start coding! Happy coding! 🐍