So hello welcome back our lovely audience today we will discuss about a huge topic which is very useful for the person who want to make a simple calculator in Python which is used to add any number so read this article carefully to know how to write a simple program which we can used to add any two numbers so let's get started.
Firstly you need to install a interpreter in your window or Android. You can run this code in your Android and window both. If you want to know how to run Python program in Android then no worry you are in right path today I will also tell you how to run Python code in your mobile.
To run Python program in Android you need to install a app in your device which is known as pydroid3 so go to play store or app store and search pydroid3 and then install it and allow all permission to this app.
Now your Android is able to run program so follow the program you can type it by yourself or just copy paste.
Follow this code are as:-
Num1= (int(input("enter your first number:-")))
Num2 = (int(input("enter your second number:-")))
print (Num1 + Num2)
So this is the code which make a simple calculator in your interpreter so now we need to understand the concept behinds this code so our first line in this code is "Num1 = (int(input("enter your first number")
We give a value of "Num1" to our interpreter then we stopped "int" because we calculate integers by using this so we add int now we add "input" to get input from our users which they need to add them we type a strings which we want to print.
Same thing applied in "Num2" we use it to give value of Num2 to our interpreter and as "int" to add integers and "input" to get input from users and then we use string to show the users.
In third line we use "print" to print the output so we use print function now we add Num1 and Num2 by using this symbol "+". Then your out shown in screen so this is then complete concepts behind this code I hope you understand this.
Congratulations 🎉 now run this code and share with your friend and say him too use your calculator and we post many article related them so kindly visit our site regularly to make more interesting program like this.
This is the first article about Python so I hope you get knowledge from this article and if you having doubts then you also see video tutorial on YouTube of this article so kindly click in this button to watch video tutorial:-
Thanks 😊 all of you and say congratulations again 👍 for getting success in your first program.



No comments: