Logo

dev-resources.site

for different kinds of informations.

First Python Program

Published at
7/16/2024
Categories
calculator
Author
mani_prabhu_m
Categories
1 categories in total
calculator
open
Author
13 person written this
mani_prabhu_m
open
First Python Program

while "True":

    print ("CALCULATOR")
    print ("Select Operation:")
    print ("1. Add")
    print ("2. Subtract")
    print ("3. Multiplication")
    print ("4. Division")
    print ("5. Modulus")
    print ("6. Exponentiate")

    choice = input("Enter Choice (1/2/3/4/5/6/7): ")

    if choice == "7":
       print ("Thank you for using calculator")

    elif choice < "7":

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

    elif choice > "7":
         print ("Invalid Choice")

    # Addition

    if choice == "1":
       result = num1 + num2
       print ("result is: ", result)

    # Subtraction

    elif choice == "2":

       result = num1 - num2
       print ("result is: ", result)

    #Multiplication

    elif choice == "3":
       result = num1 * num2
       print ("result is: ", result)

    # Division


    elif choice == "4":
       result = num1 / num2
       print ("result is: ", result)
    # Remainder

    elif choice == "5":
       result = num1 % num2
       print ("result is: ", result)


    elif choice == "6":
       result = num1 ** num2
       print ("result is: ", result)
Enter fullscreen mode Exit fullscreen mode
calculator Article's
30 articles in total
Favicon
checking azure bom
Favicon
Creating a Basic Calculator Using HTML, CSS and JavaScript
Favicon
3 Practical Calculators to Improve Efficiency
Favicon
TipCalculator.Live
Favicon
🌡️ Specific Heat Capacity Made Simple
Favicon
Playback Speed Calculator: Your Ultimate Tool for Efficient Video and Audio Consumption
Favicon
Crafting and Integrating a Custom Term Insurance Calculator for Our WordPress Platform
Favicon
MyCalqlator - Kotlin / Android Studio
Favicon
Why 1% - 1% Isn't Zero in Your Calculator (And What It Really Means)
Favicon
How Accurate Are Tax Calculators For Pakistan?
Favicon
Using large language models and the like for arithmetic to win a prize
Favicon
The Useless Type Calculator in Typescript
Favicon
calculadora de horas trabalhadas
Favicon
How to Make a Calculator Using HTML CSS JavaScript – Step-by-Step Guide
Favicon
First Python Program
Favicon
What specific data inputs are required to use the HECS repayment calculator effectively?
Favicon
REAL WORLD APPLICATION: Statistics for Data Science
Favicon
Let's make a Calculator using Py.
Favicon
What are The Chances of Finding Your Dream Man? Probability of Finding Your Ideal Man
Favicon
Age Calculator
Favicon
How to Create a Calculator Shortcut on the Windows 11?
Favicon
Retirement Calculator
Favicon
Calculate GCD and LCM using multiple methods
Favicon
Mastering Land Conversions: From Acres to Square Feet
Favicon
Resume Worth Calculator built with Next.js
Favicon
Starbucks Nutrition and Calorie Calculator.
Favicon
Calculator with GUI Using Python Tkinter.
Favicon
Let's build a calculator
Favicon
What Is a Sales Mix Calculator and How Does It Work? Explore Now
Favicon
Basic Calculator

Featured ones: