My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Calculator

(For beginners)

Lakshaya Sharma's photo
Lakshaya Sharma
·Dec 31, 2021·

1 min read

So If You Are A beginner And Recently Started Python So This Will Be your First And Simple Project To Add Two Numbers So let's Get Started.

1. Open Your Code Editor First We Have To Gather Input From Users For That We Use input() Function.

num1 = int(input("Enter First Number: "))  
num2  = int(input("Enter Second Number: "))  

Add = num1 + num2 
Print(Add)

Let Me Explain This Program First We Take The Input From The User With The Help Of "num1" And "num2". Then We TypeCast The Value Of "num1" And "num2" In Integer With The Help of "int()" Because Input Is use Give Data In The Form Of String. Then We Add "num1" And "num2" And Store Them In A Variable Called "Add" Th We Print The Value Of "Add" With The Help Of "print() Function. Hope You All Understood It.