294,870 views
12 votes
12 votes
CALLING ALL COMPUTER SCIENCE LOVERS!!!!!!!

Can somebody please help me write a code that has the following requirements? If you cannot answer comment your code. TTHHHHHHHHAAAANNNNNNNNNK YOOOOOOOOOUU!!!!!!!!!!!!!!!!!!

Tracy will draw a picture using python.
(IT MUST BE CREATIVE)

1. for loops (at least 1)

2. Descriptive comments

3. variables (at least 2)

4. function (at least 1)

5. parameter (at least 1)

6. if or if/else (at least 1)

7. user input ( optional) ( + 2 bonus points)

User SoWhat
by
2.2k points

2 Answers

22 votes
22 votes
So you know while u are giving code for ur mail or anything else they say u to give. Captial letter small letter and put number so u just give like that only
User TimD
by
3.0k points
10 votes
10 votes

Answer:

# Instead of repeating code over and over

forward(10)

left(90)

forward(10)

left(90)

forward(10)

left(90)

forward(10)

left(90)

# Use a for loop to repeat the code!

for i in range(4):

forward(10)

left(90)

# You can use the i variable inside the loop

# i starts at 0, and goes up to COUNT-1

# This will make Tracy move forward 0, then 1, then 2

for i in range(3):

forward(i)

# You can change the value of i inside a for loop by using mathematical expressions

for i in range(3):

forward(i*10)

# You can also control the value of i by using extended parameters

for i in range(STARTING_VALUE, ENDING_VALUE, INCREMENT):

# This will move Tracy forward 25, 50, and 75 pixels

for i in range(25, 76, 25):

forward(i)

love you guys <3

User Handoko
by
3.0k points