-
Notifications
You must be signed in to change notification settings - Fork 0
/
scratch.py
executable file
·132 lines (104 loc) · 2.06 KB
/
scratch.py
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
"""
b=True
d=False
print(b and d)
print(b or d)
print(not(d))
#h = input("What is your name?")
if(a == 'yes'):
print("Now this will happen")
elif(a != 'no'):
print("Aw, why would you do that?")
else:
print("please answer yes or no")
h = "hellofsd"
l = ["jksd", 8, "klsd", True]
print(l)
f = "John"
l = "Doe"
f += " Doe"
print(f[-1])
#ans = input("So your name is %s , correct?" %(f))
from math import *
print(sqrt(49))
b=3
h=4
print(.5*b*h)
#OR
print((b*h)/2)
#OR EVEN
print(b/2*h)
colors = ["red", "blue", "orange", "purple", "white"]
colors.append("violet")
colors[-1] = "black"
del(colors[2])
print(colors[2])
print(["red"] * 4)
b=3
h=4
print(.5*b*h)
#OR
print((b*h)/2)
#OR EVEN
print(b/2*h)
for color in colors:
if color == "green":
print("Its a leaf")
print(color)
def fizzBuzz():
for i in range(1,101):
if (i % 3 == 0 and i % 5 == 0):
print("fizz buzz")
elif (i % 3 == 0):
print("fizz")
elif (i % 5 == 0):
print("buzz")
else:
print(i)
fizzBuzz()
fizzbuzz()
def triangle(b,h):
return(.5*b*h)
from apcs import *
Window.size(500,500)
Window.out.background("white")
#x = 0
color = "red"
def main():
#global x
global color
x = Window.mouse.getX()
y = Window.mouse.getY()
if Window.mouse.clicked():
if x >= 90 and x <= 110 and y >= 90 and x <= 110:
color = "green"
Window.out.color(color)
Window.out.rectangle(100,100,20,20)
Window.frame(main)
Window.start()
p = [24,234,234,11]
print(p)
p[2] += 1000
print(p)
from tkinter import *
def keyup(e):
print('up', e.char)
def keydown(e):
print('down', e.char)
root = Tk()
frame = Frame(root, width=100, height=100)
frame.bind("<KeyPress>", keydown)
frame.bind("<KeyRelease>", keyup)
frame.pack()
frame.focus_set()
root.mainloop()
"""
from apcs import *
Window.size(500,500)
Window.out.background("white")
def main():
rect = Window.out.rectangle(100, 150, 100, 150)
if "mouse" in Window.touching(rect):
print("mouse")
Window.frame(main)
Window.start()