making a calculator in python

preview_player
Показать описание
In this video I will tell you how to make a calculator using python for beginner

*********************WeLcOmE***********************
In this video, I am going to make a basic calculator in python in 1 minutes
If you enjoy this video you can share it and like to this video and subscribe to our channel

Python is a very useful language to learn if you are interested in python this video will definitely help you

If you want more videos in python please comment me in the comment section.

Welcome to my YouTube channel TechExplainer please subscribe my channel to watch my latest video.

In this video :- I will tell you how to make a guess the number game in python , If you are beginner this can help you to learn coding .

And also comment your opinions in the chat box and kepp me supporting

Рекомендации по теме
Комментарии
Автор

Just type
print(eval(input("enter a problem: ")))

eyadhassanel-gamer
Автор

This one without making more user inputs:


operation = input("Enter your operation: ")
parted = operation.split()
FirstNumber = int(parted[0])
Operation = parted[1]
SecondNumber = int(parted[2])



if Operation == '+':
Answer = FirstNumber + SecondNumber
elif Operation == '-':
Answer = FirstNumber - SecondNumber
elif Operation == '×':
Answer = FirstNumber * SecondNumber

elif Operation == '/':
Answer = FirstNumber / SecondNumber
elif Operation == "^":
Answer = FirstNumber ** SecondNumber


else:
print("Operation not found!")

print("The Answer of your Question is : ", Answer)

kailashpwankhede
Автор

number1 = int(input("enter the number"))
sign = input("enter the sign")
number2 = int(input("enter the number"))

if sign == '+':
print("your result is " + str(number1 + number2))
elif sign == "-":
print("your result is " + str(number1 - number2))
elif sign == "*":
print("your result is " + str(number1 * number2))
elif sign == "/":
print("your result is " + str(number1 / number2))
else:
print("invalid operator")

deltacross