MCPcopy Create free account
hub / github.com/geekcomputers/Python / main

Function main

calculator.py:101–125  ·  view source on GitHub ↗

main-program purpose: handles user input and prints information to the console.

()

Source from the content-addressed store, hash-verified

99
100
101def main():
102 """
103 main-program
104 purpose: handles user input and prints
105 information to the console.
106 """
107
108 print(
109 "\nScientific Calculator\n\nFor Example: sin(rad(90)) + 50% * (sqrt(16)) + round(1.42^2)"
110 + "- 12mod3\n\nEnter quit to exit"
111 )
112
113 if sys.version_info.major >= 3:
114 while True:
115 k = input("\nWhat is ")
116 if k == "quit":
117 break
118 result(k)
119
120 else:
121 while True:
122 k = raw_input("\nWhat is ")
123 if k == "quit":
124 break
125 result(k)
126
127
128if __name__ == "__main__":

Callers 1

calculator.pyFile · 0.70

Calls 1

resultFunction · 0.70

Tested by

no test coverage detected