Exercise 1: Calculator using Python (Solution) | Python Tutorial - Day #8

preview_player
Показать описание
Python is one of the most demanded programming languages in the job market. Surprisingly, it is equally easy to learn and master Python. This python tutorial for absolute beginners in Hindi series will focus on teaching you python concepts from the ground up.

python, C, C++, Java, JavaScript and Other Cheetsheets [++]:

►Learn in One Video[++]:

►Complete course [playlist]:

Follow Me On Social Media
Comment "#HarryBhai" if you read this 😉😉
Рекомендации по теме
Комментарии
Автор

Day 8 present, consistency ✌️(start se consistency laga ra hu tho present laga k flow break nai kar sakta 😅) ..and I am eagerly waiting for Day 9 and tough exercises in future 💪.. love you Harry Bhai ❤️

oo-tes
Автор

print("Hello sir")
a=int(input("Entre a first number"))
b=int(input("Entre a second number"))
print("The sum is=", a+b )
print("The Subtraction is=", a-b)
print("The multiplication is=", a*b)
print("The division is=", a/b)
print("The mode is =", a%b)

MuzammalKahloon
Автор

Bhai thoda basic to bata hi dete ek program ke example se😢

igf
Автор

Here are some Repl based shortcuts
Run repl. ctrl + enter.
Open shell. ctrl + shift + s.
open preferences. ctrl +,
Open version control sidebar. ctrl + shift + g.
open debugger. ctrl + shift + d.
toggle command bar. ctrl + .
Open multiplayer mode. ctrl + shift + m.
Open packages sidebar. ctrl + shift + L.

Amtk
Автор

print('Exercise')
a = int(input("Enter a number"))
b = int(input('Enter a number'))
print('Which operation do you perform, If you want to perform print 1 for addition, 2 for subtraction 3 for multiplication 4 for division and 5 for floor division 6 for exponential form 7 for the remainder . While looking the answers remember that all things consider a first ')
d= int(input('Enter any of the above numbers '))
if d==1:
print("The sum of the number is ", a+b)
elif d==2:
print("The subtractation of the numbers is ", a-b)
elif d==3:
print("The product of the numbers is ", a*b)
elif d==4:
print("The division quotient of the number is", a/b)
elif d==5:
print("The floor division of the number is ", a//b)
elif d==6:
print("The exponential form of the number is ", a**b)
elif d==7:
print("The remainder of the numbers is ", a%b)
elif d==0:
print("The option does not exist")
elif d>7:
print('It seems that you have chosed incorrect option')
print("Thank you for using my calculator")

anshulkahane
Автор

You didn't tell us how to create calculator

miz_mizpah
Автор

a=int(input("Enter the value of a = "))
b=int(input("Enter the value of a = "))

print("a+b =", a+b)
print("a-b =", a-b)
print("a*b =", a*b)
print("a/b =", a/b)
print("a Percentile b", a%b)

shivanidhyani
Автор

a = int(input("entre your 1 no\n"))
b = int(input("entre your 2 no\n"))
print ("addition of a and b")
print(a + b)
print ("subtraction of a and b")
print (a - b)
print ("multiplication of a and b")
print (a*b)
print("division of a and b")
print (a/b)
print ("flot division of a and b")
print (a//b)
print("modulo of a and b")
print (a%b)
print ("thank you for this 100 days course of python")

unknownbhai
Автор

Going to be honest here,
I brainstormed till headache as to how can i make a code in which i give an option to input a number to the user, but with the 7 videos of knowledge how could i have done that 😅
So thank you harry bhaiya for your morale support in each and every video, ❤

uditthakur
Автор

Bhaiya mere pass PC nahi hai to maine apna program mobile mai likh ke run kiya hai.. Thank you bhaiya aap bohot achhha padhate hai. Aur isse pehle maine koi program nahi likha tha apni life mai khud se but aaj maine pehla program likha other than hello world aur mughe bohot khushi bohot khushi bohot khusii ho rahi hai, thank you bhaiya

print("****Addition of Two Numbers****")
a =int(input("Enter the number 1:"))
b =int(input("Enter the number 2:"))
add = a+b
print("Addition of numbers are", add)

print("****Substraction of Two Numbers****")
c =int(input("Enter the number 1:"))
d= int(input("Enter the number 2:"))
sub = c-d
print("Substraction of numbers are", sub)

print("****Multiplication of Two Numbers****")
e =int(input("Enter the number 1:"))
f =int(input("Enter the number 2:"))
mul =e-f
print("Multiplication of numbers are", mul)

of Two Numbers****")
g =int(input("Enter the number 1:"))
h =int(input("Enter the number 2:"))
div =g/h
print("Division of Numbers are", div)

suchitathakur
Автор

Harry Bhaiya thank you for all ur free courses and I am getting very much help learning new skills from you and again thank you bhaiya for making us uprade in coding skills 😇

utkarshpandey
Автор

Exercise Done 👍
Jitna Sikhaya Hai Utna Use Karke
Because I had just Started Programming

RaunakBisht-pv
Автор

a=1
B=1
Print(a+b)
Print(a-b)
Print(a*b)
Print(a/b)
Can we made like that?

hinasehrish
Автор

Well for those who are just starting
def add (x, y):
return x+y
def subtract (x, y):
return x-y
and so on it is much easier to do it like this and it runs faster

govind
Автор

I'm Present Sir .
05th December 2022
Monday
04:40 pm PST
Respect and love for you Harry bhai from Pakistan .
You're a great and sincere teacher .
May Allah Pak bless you Sir Haris Ali Khan Sahab

owaisnadeem
Автор

n=15
m=7
ans1= n+m
print ("addition of", n, "and", m, "is", ans1 )
ans2=n-m
print ("subtraction of", n, "and", m, "is", ans2 )
ans3= n*m
print ("multiplication of", n, "and", m, "is", ans3 )
ans4= n/m
print ("division of", n, "and", m, "is", ans4 )
ans5= n%m
print("modulus of", n, "and", m, "is", ans5 )
ans6=n//m
print ("floor division of", n, "and", m, "is", ans6 )

soumitrasahoo
Автор

well, I did it quite different. I did it as

a = 15
b = 12
c = a + b
d = a - b
e = a * b
f = a / b
g = a % b
h = a ** b
i = a // b

print("The addition of", a, "+", b, "is", c)

dubbedanbis
Автор

Easy calculator

a= 78972
b= 920102
Sum= a+b
print (sum)

aamilashraf.
Автор

I felt a bit nervous as I hadn't complete the 1st task given by you but I will continuing with your educational videos. I'm working with an NGO and in free time watched your videos to learn something new. Thanks a lot bro.

juanidahmed
Автор

num1 = int(input("Enter first number: "))
Operator=input("Enter any operator: + , - , * , / , // , % : ")
num2 = int(input("Enter second number: "))
if Operator =='+' :
print("Addition of both numbers is :: ", num1+num2)
elif Operator =='-' :
print("Subtraction of both numbers is :: ", num1-num2)
elif Operator =='*' :
print("multiplication of both numbers is :: ", num1*num2)
elif Operator =='/':
print("Division of both numbers is :: ", num1/num2)
elif Operator =='%':
print("Remainder is :: ", num1%num2)
elif Operator =='//' :
print(" precise-Devision of both numbers is :: ", num1+num2)
else :
print("Invalid Operator")

Mughal-iidq
welcome to shbcf.ru