50 Basic Question Python
50 Basic Question Python
6. Write a Python program to calculate the greatest common divisor (GCD) of two numbers.
7. Write a Python program to calculate the least common multiple (LCM) of two numbers.
11. Write a Python program to find the sum of the first 'n' natural numbers.
12. Write a Python program to find the sum of all even numbers between two given numbers.
13. Write a Python program to find the product of two numbers without using the '*' operator.
17. Write a Python program to swap two numbers without using a temporary variable.
18. Write a Python program to calculate the power of a number using a loop.
19. Write a Python program to print the multiplication table of a given number.
37. Write a Python program to find the sum of all prime numbers between two given numbers.
40. Write a Python program to find the sum of squares of the first 'n' natural numbers.
42. Write a Python program to find the largest factor of a number other than itself.
43. Write a Python program to calculate the square root of a number without using built-in
functions.
44. Write a Python program to count the number of occurrences of a character in a string.
47. Write a Python program to calculate the sum of all odd numbers between two given numbers.
48. Write a Python program to calculate the sum of all multiples of 3 or 5 below 1000.
49. Write a Python program to reverse the digits of a number without converting it to a string.