-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.py
More file actions
43 lines (38 loc) · 904 Bytes
/
script.py
File metadata and controls
43 lines (38 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#Variable variables (cliche)
var = None
var_name = None
#Functions of Wy
def variable():
global var, var_name
var_name = input("Name your variable:")
var = input(f"{var_name}-)")
def log():
output = input(">>")
if output != f"log<{var_name}>":
print(output[5:-2])
elif output == f"log<{var_name}>":
print(var)
def boolean():
value = input(">>")
if value == f"{var_name}?={var}":
print("True")
elif value != f"{var_name}?={var}":
print("False")
def maths():
global var,var_name
arithmetic = input(">>")
print(eval(arithmetic))
#Command Loop
while True:
command = input(">>")
if command == "variable":
variable()
elif command == "log":
log()
elif command == "boolean":
boolean()
elif command == "maths":
maths()
else:
print("Invalid input.")
break