-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.py
More file actions
54 lines (48 loc) · 1.23 KB
/
Copy pathscript.py
File metadata and controls
54 lines (48 loc) · 1.23 KB
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
44
45
46
47
48
49
50
51
52
53
54
#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))
def wy_list():
list_name = input(">>Name your list:")
items_input = input(">>Enter items separated by commas: ")
varia = [item.strip() for item in items_input.split(",")]
wylang_list = f'{list_name}={varia}'
print(f'>>{wylang_list}')
#Command Loop
while True:
command = input(">>")
if command == "variable":
variable()
elif command == "log":
log()
elif command == "boolean":
boolean()
elif command == "maths":
maths()
elif command == "list":
wy_list()
elif command == "quit":
break
else:
print("Invalid input.")
break