0% found this document useful (0 votes)
4 views2 pages

Python Basic Problem Solving Guide

The document outlines basic Python problem-solving exercises, including tasks such as checking if a number is even or odd, finding the largest of three numbers, and checking for prime numbers. It also covers concepts like reversing a number, calculating factorials, generating Fibonacci series, and identifying palindrome numbers. Additional exercises involve working with lists, strings, and implementing algorithms like GCD and leap year checks.

Uploaded by

727721eumt072
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Python Basic Problem Solving Guide

The document outlines basic Python problem-solving exercises, including tasks such as checking if a number is even or odd, finding the largest of three numbers, and checking for prime numbers. It also covers concepts like reversing a number, calculating factorials, generating Fibonacci series, and identifying palindrome numbers. Additional exercises involve working with lists, strings, and implementing algorithms like GCD and leap year checks.

Uploaded by

727721eumt072
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Basic Python Problem Solving Exercises

1. Even or Odd

Check if a number is even or odd using modulus operator.

2. Largest of 3 Numbers

Use if-elif-else to find the biggest among three inputs.

3. Check for Prime Number

Loop from 2 to num-1 to check if num is divisible.

4. Reverse a Number

Use while loop and modulus to reverse the digits.

5. Palindrome Number

Check if original and reversed number are equal.

6. Factorial

Multiply all numbers from 1 to n using for loop.

7. Fibonacci Series

Print the first n numbers in the Fibonacci sequence.

8. Sum of Digits

Extract digits using %, add to sum.

9. Armstrong Number (3-digit)

Sum of cubes of digits equals number.

10. Multiplication Table

Use for loop from 1 to 10.

11. Count Digits

Divide by 10 until number is 0.


12. Check Leap Year

Apply leap year condition using if.

13. Find GCD

Use Euclidean algorithm with while loop.

14. List Even Numbers in Range

Use for loop and if condition.

15. Sum of List Elements

Loop through list and add elements.

16. Max and Min in List

Use built-in max() and min().

17. Count Vowels in String

Loop through characters and count vowels.

18. Palindrome String

Check if string is equal to its reverse.

19. Star Triangle

Use nested loop or string multiplication.

20. Reverse Star Triangle

Print stars in decreasing order.

You might also like