-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsquare_loop.py
246 lines (212 loc) · 7.94 KB
/
square_loop.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
Python 3.11.3 (v3.11.3:f3909b8bc8, Apr 4 2023, 20:12:10) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license()" for more information.
import ensurepip
ensurepip.bootstrap()
!pip3 install numpy
SyntaxError: invalid syntax
ip3 install numpy
SyntaxError: invalid syntax
pip3 install numpy
SyntaxError: invalid syntax
pip3 install requests
SyntaxError: invalid syntax
SyntaxError: invalid syntax
SyntaxError: incomplete input
numpy
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
numpy
NameError: name 'numpy' is not defined
2+2
4
nam=input('Who are you')
Who are you
print('Welcome', nam)
Welcome
nam=input('Who are you')
Who are you
Chuck
Traceback (most recent call last):
File "<pyshell#14>", line 1, in <module>
Chuck
NameError: name 'Chuck' is not defined
===== RESTART: /Users/annamariebenzon/Documents/AI & ML research/sample.py =====
Who are you
Traceback (most recent call last):
File "/Users/annamariebenzon/Documents/AI & ML research/sample.py", line 2, in <module>
print('Welcome', num)
NameError: name 'num' is not defined. Did you mean: 'nam'?
===== RESTART: /Users/annamariebenzon/Documents/AI & ML research/sample.py =====
Who are you
Welcome
===== RESTART: /Users/annamariebenzon/Documents/AI & ML research/sample.py =====
Who are you Chuch
Welcome Chuch
===== RESTART: /Users/annamariebenzon/Documents/AI & ML research/sample.py =====
Who are you Anna Marie
Welcome Anna Marie
===== RESTART: /Users/annamariebenzon/Documents/AI & ML research/Circle.py =====
Traceback (most recent call last):
File "/Users/annamariebenzon/Documents/AI & ML research/Circle.py", line 5, in <module>
C1=Circle(10,"red")
TypeError: Circle() takes no arguments
===== RESTART: /Users/annamariebenzon/Documents/AI & ML research/Circle.py =====
C1=Circle(10,"red")
Traceback (most recent call last):
File "<pyshell#16>", line 1, in <module>
C1=Circle(10,"red")
TypeError: Circle() takes no arguments
C1.radius=10
Traceback (most recent call last):
File "<pyshell#17>", line 1, in <module>
C1.radius=10
NameError: name 'C1' is not defined
===== RESTART: /Users/annamariebenzon/Documents/AI & ML research/Circle.py =====
C1=Circle(10,"red")
Traceback (most recent call last):
File "<pyshell#18>", line 1, in <module>
C1=Circle(10,"red")
TypeError: Circle() takes no arguments
===== RESTART: /Users/annamariebenzon/Documents/AI & ML research/Circle.py =====
Traceback (most recent call last):
File "/Users/annamariebenzon/Documents/AI & ML research/Circle.py", line 6, in <module>
C1=Circle(2,"red")
TypeError: Circle() takes no arguments
===== RESTART: /Users/annamariebenzon/Documents/AI & ML research/Circle.py =====
radius: 2
color: red
===== RESTART: /Users/annamariebenzon/Documents/AI & ML research/Circle.py =====
radius: 2
color: red
Traceback (most recent call last):
File "/Users/annamariebenzon/Documents/AI & ML research/Circle.py", line 16, in <module>
fist_circle.drawCircle()
NameError: name 'fist_circle' is not defined. Did you mean: 'first_circle'?
===== RESTART: /Users/annamariebenzon/Documents/AI & ML research/Circle.py =====
radius: 2
color: red
Traceback (most recent call last):
File "/Users/annamariebenzon/Documents/AI & ML research/Circle.py", line 16, in <module>
first_circle.drawCircle()
AttributeError: 'Circle' object has no attribute 'drawCircle'
import turtle
import turtle as t
t.color('red')
=========== RESTART: /Users/annamariebenzon/Documents/Draw circle.py ===========
Traceback (most recent call last):
File "/Users/annamariebenzon/Documents/Draw circle.py", line 1, in <module>
t.color('red')
NameError: name 't' is not defined
=========== RESTART: /Users/annamariebenzon/Documents/Draw circle.py ===========
Traceback (most recent call last):
File "/Users/annamariebenzon/Documents/Draw circle.py", line 3, in <module>
t.begin_fil()
AttributeError: module 'turtle' has no attribute 'begin_fil'. Did you mean: 'begin_fill'?
Exception ignored in: <function Image.__del__ at 0x105c265c0>
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tkinter/__init__.py", line 4083, in __del__
self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
================================ RESTART: Shell ================================
======== RESTART: /Users/annamariebenzon/Documents/Elevator converter.py =======
Europe floor?0
US floor is 1
======== RESTART: /Users/annamariebenzon/Documents/Elevator converter.py =======
Europe floor? 6
US floor is 7
============= RESTART: /Users/annamariebenzon/Documents/payment.py =============
Enter hours: 40
Enter pay: 50
============= RESTART: /Users/annamariebenzon/Documents/payment.py =============
Enter hours: 5
Enter pay: 6
============= RESTART: /Users/annamariebenzon/Documents/payment.py =============
Enter hours: 80
Enter pay: 20
Your total salary is: 1600.0
=========== RESTART: /Users/annamariebenzon/Documents/conditional1.py ==========
Smaller
Traceback (most recent call last):
File "/Users/annamariebenzon/Documents/conditional1.py", line 6, in <module>
Print ('Finis')
NameError: name 'Print' is not defined. Did you mean: 'print'?
=========== RESTART: /Users/annamariebenzon/Documents/conditional1.py ==========
Smaller
Finis
=========== RESTART: /Users/annamariebenzon/Documents/conditional1.py ==========
Number: 7
Smaller
Finis
=========== RESTART: /Users/annamariebenzon/Documents/conditional1.py ==========
Number: 80
Bigger
Finis
= RESTART: /Users/annamariebenzon/Documents/AI & ML research/conditional greater than 5.py
Number is: 5
Equals 5
Greater than 4
Greater than or Equals to 5
Less than 6
Less than or Equals 5
Not equal 6
= RESTART: /Users/annamariebenzon/Documents/AI & ML research/conditional greater than 5.py
Number is: 5
Equals 5
Greater than 4
Greater than or Equals to 5
Less than 6
Less than or Equals 5
Not equal 6
Finis
= RESTART: /Users/annamariebenzon/Documents/AI & ML research/conditional greater than 5.py
Number is: 5
Equals 5
Finish
= RESTART: /Users/annamariebenzon/Documents/AI & ML research/conditional greater than 5.py
Number is: 7
Greater than 5
Finish
= RESTART: /Users/annamariebenzon/Documents/AI & ML research/conditional greater than 5.py
Number is: 3
Less than 5
Finish
= RESTART: /Users/annamariebenzon/Documents/AI & ML research/Python Exercises/Concert conditional.py
What is your age? 10
Traceback (most recent call last):
File "/Users/annamariebenzon/Documents/AI & ML research/Python Exercises/Concert conditional.py", line 3, in <module>
if (age>18):
TypeError: '>' not supported between instances of 'str' and 'int'
= RESTART: /Users/annamariebenzon/Documents/AI & ML research/Python Exercises/Concert conditional.py
What is your age? 10
go see meat loaf
move on
>>>
= RESTART: /Users/annamariebenzon/Documents/AI & ML research/Python Exercises/Concert conditional.py
What is your age? 18
go see Pink Floyd
move on
>>>
= RESTART: /Users/annamariebenzon/Documents/AI & ML research/Python Exercises/Concert conditional.py
What is your age? 19
you can enter
move on
>>>
= RESTART: /Users/annamariebenzon/Documents/AI & ML research/Python Exercises/circle draw.py
>>>
================================ RESTART: Shell ================================
>>>
=== RESTART: /Users/annamariebenzon/Documents/AI & ML research/square_loop.py ==
Traceback (most recent call last):
File "/Users/annamariebenzon/Documents/AI & ML research/square_loop.py", line 3, in <module>
square[i]="white"
NameError: name 'square' is not defined. Did you mean: 'squares'?
>>>
=== RESTART: /Users/annamariebenzon/Documents/AI & ML research/square_loop.py ==
Traceback (most recent call last):
File "/Users/annamariebenzon/Documents/AI & ML research/square_loop.py", line 3, in <module>
square[i]="white"
NameError: name 'square' is not defined. Did you mean: 'squares'?
>>>
=== RESTART: /Users/annamariebenzon/Documents/AI & ML research/square_loop.py ==
>>> print(squares)
['white', 'white', 'white', 'white', 'white']