All python functions at least I know will work in this calculator. The new functions are:
prime(number) – returns True if the number is prime, otherwise it returns false
composite(number) – returns oposite of prime()
encode(name, string) – returns the encoded version of your message using the given variable
decode(name, string) – returns the decoded version of your message using the given variable
Check the Python Documents: docs.pyton.org
version = '1.0.0a0' print("Ultimate Calculator " + str(version)) def prime(number): if number == 1: return False elif number <= 0: return False elif number % 2 != 0: nnumber = int(round(number / 2, 0)) for i in range(3, nnumber + 1): if number % i == 0: return False elif number % i != 0 and i == nnumber: return True elif number == 2: return True else: return False def composite(mnumber): return not prime(mnumber) test = {'a': '=', 'b': '(', 'c': ')', 'd': '[', 'e': ']', 'f': '{', 'g': '}', 'h': '!', 'i': '@', 'j': '#', 'k': '$', 'l': '%', 'm': '&', 'n': '+', 'o': '-', 'p': '*', 'q': '/', 'r': '*', 's': '<', 't': '>', 'u': '?', 'v': ';', 'w': ':', 'x': '_', 'y': '.', 'z': '\\'} #Syntax: variable = {character_to_encode: character_comes_out, ...} funny = {'5': 'l', 'y': 'm', 'e': 'w', 'v': 'g', 's': 'a'} def encode(name, string): lis = '' for i in range(len(string)): for l in range(255): try: if l == ord(string[i]): lis = lis + name[chr(l)] except: lis = lis + string[i] return lis def decode(name, string): lis = '' name = dict(zip(name.values(), name.keys())) for i in range(len(string)): for l in range(255): try: if chr(l) in string[i]: lis = lis + name[chr(l)] except: lis = lis + string[i] return lis while True: try: x = eval(input()) if x != None: print(x) except KeyboardInterrupt: raise KeyboardInterrupt except: print('Error')