Skip to content
View in the app

A better way to browse. Learn more.

GAMELIFE România

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Python] O funcție pentru un pătrat

python-3.svg

 

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

 

76561198361326087.png

TS3 SERVER : 193.84.64.140:10017

174855.png  facebook-new.png

#statiincasa

Featured Replies

No posts to show

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.