how to make advanced calculator in python with simple gui interface in terminal

Solutions on MaxInterview for how to make advanced calculator in python with simple gui interface in terminal by the best coders in the world

showing results for - "how to make advanced calculator in python with simple gui interface in terminal"
Tim
22 Nov 2016
1logo = """
2 _____________________
3|  _________________  |
4| |    Calulator    | |  
5| |_________________| | 
6|  ___ ___ ___   ___  | 
7| | 7 | 8 | 9 | | + | | 
8| |___|___|___| |___| | 
9| | 4 | 5 | 6 | | - | | 
10| |___|___|___| |___| | 
11| | 1 | 2 | 3 | | x | | 
12| |___|___|___| |___| | 
13| | . | 0 | = | | / | | 
14| |___|___|___| |___| |  
15|_____________________|
16
17"""
18
19
20while True:
21    
22    print(logo)
23    def addition(Num1,Num2):
24        return Num1 + Num2
25    def Subtract(Num1,Num2):
26        return Num1 - Num2
27    def Multiply(Num1, Num2):
28        return(Num1 * Num2)
29    def divide(Num1,Num2):
30        return Num1 / Num2
31    Num1_value = int(input("Number 1:- "))
32    Opration = str(input("Which opration do you want to do +, -, *, /:- "))
33    Num2_value = int(input("Number 2:- "))
34    if Opration == "+":
35        ans = str(addition(Num1_value,Num2_value))
36    elif Opration == "-":
37        ans = str(Subtract(Num1_value,Num2_value))
38    elif Opration == "*":
39        ans = str(Multiply(Num1_value,Num2_value))
40    elif Opration == "/":
41        ans = str(divide(Num1_value,Num2_value))
42    else:
43        print("Input is incorrect")
44    ans2 = ans
45    logo2 = """
46               _____________________
47              |  _________________  |
48              | |  """+ans2+"""       
49              | |_________________| |
50              |  ___ ___ ___   ___  | 
51              | | 7 | 8 | 9 | | + | | 
52              | |___|___|___| |___| | 
53              | | 4 | 5 | 6 | | - | | 
54              | |___|___|___| |___| | 
55              | | 1 | 2 | 3 | | x | | 
56              | |___|___|___| |___| | 
57              | | . | 0 | = | | / | | 
58              | |___|___|___| |___| |  
59              |_____________________|
60              """
61    print(logo2)
62    continue_or_not = str(input("Do You Want to Continue 'Yes' or 'No':- ")).lower()
63    if continue_or_not == "yes":
64        continue
65    elif continue_or_not == "no":
66        break
67    else:
68        print("Try again")