mohammad-cse / Basic-Python-01

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Basic Python 01

Variables :

  1. Write a program that swaps the values of two variables.
  2. Write a program that calculates the area of a rectangle given its length and width.
  3. Write a program that converts temperature from Fahrenheit to Celsius.
  4. Write a program that calculates the volume of a sphere given its radius.
  5. Write a program that finds the average of three numbers.

If-elif-else :

  1. Write a program that determines if a number is even or odd.
  2. Write a program that finds the maximum of three numbers.
  3. Write a program that determines if a year is a leap year or not.
  4. Write a program that determines if a number is positive, negative, or zero.
  5. Write a program that calculates the grade based on a given percentage.

For Loop :

  1. Write a program that prints the first n natural numbers.
  2. Write a program that calculates the factorial of a number.
  3. Write a program that generates a Fibonacci sequence of length n.
  4. Write a program that checks if a given number is prime or not.
  5. Write a program that prints the multiplication table of a given number.

While Loop :

  1. Write a program that finds the sum of all even numbers between 1 and n.
  2. Write a program that reverses a given number.
  3. Write a program that checks if a given string, is a palindrome.
  4. Write a program that generates a random number and allows the user to guess it.
  5. Write a program that finds the greatest common divisor (GCD) of two numbers.

About


Languages

Language:Jupyter Notebook 100.0%