Skip to main content

Posts

Showing posts from February, 2022

Programe to check whether the number is prime or not.

 Programe to check whether the number is prime or not. n = int(input("Enter a number :")) for i in range (2 , n + 1): if n % i == 0: break if i == n: print(n,"is prime number") else: print(n,"is not a prime Number") for execution and output so check the video.

write a python programe to print the following pyramid : 1 # 2 3 # 4 5 6 # 7 8 9 10 # 11 12 13 14 15

  write a python programe to print the following pyramid : # 1 # 2 3 # 4 5 6 # 7 8 9 10 # 11 12 13 14 15 count = 1 for i in range (1,6): for i in range(1,i+1): print(count,end=" ") count=count+1 print() for execution and output so check the video.

write a python program to use of while loop.

 write a python program to use of while loop. count =1 while(count<10):     print("The Count is :",count)     count = count + 1 print("Out of While Loop") for execution and output so check the video.

write a python program to print vowels in a message / string

  write a python program to print vowels in a message / string input = "Republic Day" output = e                   u                   i                     a msg = "Republic Day" data = list() vowel = "aeiou" for ch in msg :     if ch in vowel:         print(ch)         data.append(ch) print(data) for execution and output so check the video.

Write a python Program to swap the value of two varibles.

  Write a python Program to swap the value of two varibles. num1 = input("Enter a number :") num2 = input("Enter a number :") print("\nNumber Before swapping ") print("Number 1 :",num1) print("Number 2 :",num2) temp = num1 num1 = num2 num2 = temp print("\nNumber after Swapping ") print("Number 1 :",num1) print("Number 2 :",num2) for execution and output so check the video.

write a python program to check the largest number among the three numbers.

write a python program to check the largest number among the three numbers. x = input("Enter a Number :") y = input("Enter a Number :") z = input("Enter a Number :") if(x>y) and (y>z):     l = x           #l is used for to store a value elif(y>x) and (y>z):     l = y else:     l = z print("\nLargest Number is :",l) for execution and output so check the video.

write a python program to check if a Number is Positive , Negative or Zero.

 write a python program to check if a Number is Positive , Negative or Zero. num = int(input("Enter a number :")) if num < 0:     print(num,"is Negative") elif num==0:     print(num,"is Zero") else:     print(num,"is Positive") for execution and output so check the video.

write a python program to check whether a number is Even or Odd.

 write a python program to check whether a number is Even or Odd. num = int(input("Enter a Number :")) if num%2==0:     print(num,"is Even") else:     print(num,"is Odd") for execution and output so check the video.

write a python program to find out absolute value of an input number.

 write a python program to find out absolute value of an input number. n = int(input("Enter a Number :")) if n<0:     n = - n print(n,"is Absolute Value :",n) for execution and output so check the video.

write a python program to check if the input year is leap year or not .

 write a python program to check if the input year is leap year or not . year =int(input("Enter a Year :")) if year %4==0 and year%100!=0 or year%400==0:     print(year,"is a Leap Year ") else:     print(year,"is not a Leap Year") for execution and output so check the video.

write a python program to use a If-else Statement.

 write a python program to use a If-else Statement. i =int(input("Enter a Number:")) if(i<20):     print("i is Smaller than 20") else:     print("i is Greater than 25") print("Out of if else statement") for execution and output so check the video.  

write a Python Program to convert bits to Megabytes ,Gigabytes and Terabytes.

  write a Python Program to convert bits to Megabytes ,Gigabytes and Terabytes. B = input ("Enter a bit ") B = float (B) KB = B / 1024 MB = B /(1024 * 1024) GB = B /(1024 * 1024 *1024) TB = B / (1024 * 1024 * 1024 * 1024) print(B , "Kilobytes is :",KB) print(B , "Megabytes is :",MB) print(B , "Gigabytes is :",GB) print(B , "Terabytes is :",TB) for execution and output so check the video.

write a python program to find square root of a number

 write a python program to find square root of a number num = input ("Enter a Number : ") num = int (num) sqrt = num ** 0.5 print(num , "Squareroot is : ",sqrt) for execution and output so check the video.

write python program to convert US dollar into Indian rupees

write python program to convert US dollar into Indian rupees  D = input ("Enter a Dollar to convert in Indian Rupees :") D = float (D) R = D * 70 print("The Dollar is :",D) print("Converting a Dollar into Indian Rupees :",R) for execution and output so check the video.