Type Casting
print("******Calculator******\nby DPKART")
print("Type the numbers")
print ("Lets's Start")
a=240
b=680
print(a)
print(b)
print("First Number" ,a)
print("Second Number" ,b)
#+ ||
print("\tSUM +\t ||\t",a+b)
print("\tDeduction -\t ||\t",a-b)
print("\tMultiplied *\t ||\t",a*b)
print("\t/Divided\t ||\t",a/b)
# print("Below is the text version of the calculator")
# print("Every time you want results run the same code again & again")
# print("Let's add both of them",a+b)
# print("Substracting the second from first",a-b)
# print("multiplying=",a*b)
# print("Dividing the first with second",a/b)
# print("Every time you want results run the same code again & again")
c=("Addition ")
d=("Substraction")
e=3.08
f=15.40
print("Combination of a & b")
print(int(a) + (b))
print("Combination of c & d")
print(str(c) + (d))
print("Combination of e & f")
print(float(e) + (f))
# similar data type hona chahiye and sahi operator use karna hai
# jaise ki str and float and int ka combination ho sakta hai
# implicit typecasting.
g=2.65
h=7
print("Combination of g & h")
print(g+h)
print("Substraction of g & h")
print(g-h)
print("Multiplication of g & h")
print(g*h)
print("Bhaaga of g & h")
print(g/h)
i = input("Deepak ")
print("My name is", i)
j = input("680 ")
k = input("21 ")
print(j + k)
print(int(j) + int(k))
Comments
Post a Comment