FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-programming/lab-1/2x2-square.py at main · unrealapex/python-programming · GitHub
unrealapex
/
python-programming
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-programming
/
lab-1
/
2x2-square.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
17 lines (15 loc) · 476 Bytes
Breadcrumbs
python-programming
/
lab-1
/
2x2-square.py
Copy path
File metadata and controls
17 lines (15 loc) · 476 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import
turtle
import
time
# draw a 100 x 100 pixel square(takes parameter size which is 100 if the no argument is given)
def
draw_square
(
size
=
100
):
for
i
in
range
(
4
):
turtle
.
forward
(
size
)
turtle
.
right
(
90
)
# make four squares
for
i
in
range
(
4
):
# draw a square
draw_square
()
# turn right to drawn another square
turtle
.
right
(
90
)
# keep the window open for 5 seconds after the loop is done executing so we can view the output
time
.
sleep
(
5
)
Back
|
FazBrowse Home
|
New Git URL