Posts

Program to insert a number from the user and tells the number is odd or even

Program to insert a number from the user and tells the number is odd or even source code print('Program to insert a number from the user and tells the number is odd or even') a = int(input('Enter a number = ')) print('your entered number is ',a) if a%2==0:     print("The entered number is even") else:          print("The entered number is odd")

Program for taking name and age from user and show them in which year they will move to 100 years

Program for taking name and age from user and show them in which year they will move to 100 years Source code print("Program for taking name and age from user and show them in which year they will move to 100 years") from datetime import datetime a = (input("Enter your Name = ")) print('Hello', a       ) b = int(input("Enter your age = ")) c = int((100-b) + datetime.now().year) print("You will turn to 100 years in = ", c )

The Simple Interest Program

Image
The Simple Interest Program print("\t  \t \t \t The Simple Interest Program ") a = input('\n Enter the Principal amount  = ') b = input('\n Enter the Time = ') c = input('\n Enter the Rate of interest  = ') si = (float(a) * float(b) * float(c)) / 100 print("\n The Simple Interest is = ", si)

How to import tkinter in python

Image
import tkinter in python The code for tkinter is as follow from tkinter import * root = Tk() root.mainloop()

Find the Area of a Triangle program

Image
Find the Area of a Triangle program print("\t  \t \t \t The Area of a Triangle ") a = input('\n Enter the first side of the Tirangle  = ') b = input('\n Enter the second side of the Triangle = ') c = input('\n Enter the third side of the Triangle  = ') s = float(a) / float(2.0) + float(b) / float(2.0) + float(c) / float(2.0)                                                            print("\n One side is = ", s)                                                       area = float(float(s)*(float(s)-float(a))*(float(s)-float(b))*(float(s)-                                         ...

The Square Root of the given number

Image
The Square Root of the given number print('\t\t\t\t Square Root') a = input("Enter a number = ") sq = float(a) ** 0.5 print("\n The Square Root of the number is = ", sq)

Addition of two numbers in python

Image
Addition of two numbers in python ;- It is very easy to add two numbers in python and the code are as follow print('\t \t \t Add to Numbers ') n1 = input("\n Enter first number      = ") n2 = input("\n Enter the second number = ") add = float(n1) + float(n2) print(" \nThe sum of two number is = ", add)