chiube Posted May 7, 2020 Posted May 7, 2020 O funcție pentru un pătrat Exercițiu Scrie o funție care desenează un pătrat. Poți utiliza această funcție pentru a îmbunătăți programul cu pătrate înclinate? Dacă schimbi programul pentru a folosi o funcție, este mai ușor să experimtentezi? Soluție def tilted_square(): turtle.left(20) # now we can change the angle only here for _ in range(4): turtle.forward(50) turtle.left(90) tilted_square() tilted_square() tilted_square() # bonus: you could have a separate function for drawing a square, # which might be useful later: def square(): for _ in range(4): turtle.forward(50) turtle.left(90) def tilted_square(): turtle.left(20) square() # etc TS3 SERVER : 193.84.64.140:10017 #statiincasa
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now