Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

PLP_SEE

my first calculator file

from operator import add, sub, mul

def calc(): op = input("Enter operator +-: ") n1 = int(input('Fist number: ')) n2 = int(input('Second number: ')) operators = {'+': add(n1, n2), '-': sub(n1, n2), '': mul(n1, n2)} if op in operators: print('{} {} {} = {}'.format(n1, op, n2, operators[op])) input('Press enter to return menu\n')

def menu(): while True: print('(1) Calculate 2 numbers') print('(Q) Quit') choice = input('Enter your choice: ').lower() if choice == '1': calc() elif choice == 'q': return False else: print('Not a correct choice: <{}>,try again'.format(choice))

if name == 'main': menu()

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors