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] Pătrate mai eficiente

Python_logo_wordmark.png

 

Pătrate mai eficiente

Exercițiu

Pătratele pe care le desenam la începutul acestui curs aveau multe linii de cod repetate. Poți scrie un program de desenare pătrate în mai puține linii de cod utilizând bucle?

Soluția

for _ in range(4):
    turtle.forward(100)
    turtle.left(90)

Supliment

Încearcă să faci bucle imbricate, punând una chiar după (înăuntrul) alteia, cu câteva comenzi de desen care aparțin amândorura. Uite cum poate arăta:

for ...:
    for ...:
        # drawing code inside the inner loop goes here
        ...
    # you can put some code here to move
    # around after!
    ...

Înlocuiește ... cu codul tău, și vezi dacă poți obține ceva drăguț sau interesant!

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.