My second python project.

I have now built a full calculator in python that can perform four operations between two numbers- addition, subtraction, multiplication and division.

x=int(input("Enter first number:"))
y=int(input("enter 2nd number:"))
z=input("select operation(+,-,*,/):")
if z == "+":
    print(x+y)
if z=="-":
    print(x-y)
if z=="*":
    print(x*y)
if z=="/":
    print(x/y)

import pyttsx3
engine = pyttsx3.init()


engine.say("Operation complete")
engine.runAndWait()

I have again used the input function, typecasting and the if condition. The coolest part- it speaks at the end, just like Jarvis. I used the pyttsx3 module, which converts text to speech. You can download it by running the code in your terminal:

pip install pyttsx3

This project was seriously mind blowing. I am the next Tony Stark😂

I am learning python right now from the video named “python for everyone” on freeCodeCamp’s youtube channel. Prof. Charles Severance is a really goo teacher for python.

Link for the video.

My GitHub respiratory:

GitHub

1
Subscribe to my newsletter

Read articles from Utkarsh Narayan Tiwari directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Utkarsh Narayan Tiwari
Utkarsh Narayan Tiwari