Python Exercise 2: Faulty Calculator Solution

Code file as described in the video

# 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)



Comments(2)

SumitChauhan at 2019-06-23 09:30:09 says
Its a code of previous video, kindly post the correct code
zadrain at 2019-06-23 09:30:09 says
#45*3=555 #56+9 = 77 #56/6 =4 first_number = int(input("1st number")) second_number = int(input("2nd number")) operator = (input("choose operator")) if first_number ==45 and second_number==3 and operator=="*": print("555") elif first_number ==56 and second_number==9 and operator=="+": print("77") elif first_number ==56 and second_number==6 and operator=="/": print("4") else: if operator=="+": print(first_number + second_number) elif operator=="*": print(first_number * second_number) elif operator=="/": print(first_number / second_number) elif operator=="-": print(first_number - second_number)