Exercise : Faulty Calculator

"""
Design a calculator which will correctly solve all the problem except
the following ones:
45 * 3 = 555, 56 + 9 = 77, 56 / 2 = 4
Your program should take operator and two numbers as inputs and the return
the result
"""

# # Taking inputs from user for calculate two number:
# operator = input("select your operator like ( + or - or * or / ) ")
# first = int(input("enter your number here\n" ))
# second = int(input("enter your number here\n" ))
# add = "+"
# sub = "-"
# mul = "*"
# div = "/"
#
# if operator == add:
# if first==56 and second==9:
# print("your number first + second = 77")
# else:
# print("your result is {first} + {second} =",first+second)


# for loops

# list1 = [ ["Harry", 1], ["Larry", 2],
# ["Carry", 6], ["Marie", 250]]
# dict1 = dict(list1)
#
# for item in dict1:
# print(item)
# for item, lollypop in dict1.items():
# print(item, "and lolly is ", lollypop)
# items = [int, float, "HaERRY", 5,3, 3, 22, 21, 64, 23, 233, 23, 6]
#
# for item in items:
# if str(item).isnumeric() and item>=6:
# print(item)


# while loops

# i = 10
#
# while i<100:
# print(i+1, end= " ")
# i = i + 1

Comments

Popular posts from this blog

MAP FILTER AND REDUCE FUNCTION IN PYTHON

Writing Appending to a File

Recursions: Recursive Vs Iterative Approach