• 11-qism
  • -savol Ushbu tavsiflardan qaysi biri amy.forward(100) kod qatorini aniqlaydi? 10-qism 1-savol




    Download 5.67 Mb.
    bet5/31
    Sana22.10.2022
    Hajmi5.67 Mb.
    #27828
    1   2   3   4   5   6   7   8   9   ...   31
    Bog'liq
    Uzb coders qollanma
    TITUL 2 (3)
    3-savol
    Ushbu tavsiflardan qaysi biri amy.forward(100) kod qatorini aniqlaydi?

    10-qism


    1-savol
    Kodning har bir parchasini uni tavsiflagan jumla bilan moslang.

    Izoh: Without this line, you can't do anything related to turtles. – “import turtle” qatorisiz turtle bilan hech narsa qilib bo‘lmaydi.
    Creates a new turtle and names it. – yangi turtle yaratadi va nom beradi.
    Sets the color that the turtle will use. – turtle chizadigan chiziq rangini belgilaydi.
    Makes the turtle turn right. – turtleni o‘ng tarafga buradi.
    Makes the turtle go forward. – turtleni oldinga siljitadi.
    2-savol
    Ushbu kod qismlarining har biri nimadan iborat?

    3-savol
    Xo‘sh, ushbu kod satrlarining har biri nimani anglatadi? (Kod qatorini tavsiflash uchun qaysi atamadan foydalangan bo‘lar edik?)

    4-savol

    5-savol

    6-savol

    7-savol

    8-savol

    1-yechim:
    import turtle
    amy = turtle.Turtle()
    amy.color("yellow")
    amy.forward(100)
    amy.right(90)
    amy.forward(100)
    amy.right(90)
    amy.forward(100)
    amy.right(90)
    amy.forward(100)

    2-yechim:
    import turtle
    amy = turtle.Turtle()
    amy.color("red")
    for sides in [1,2,3,4]:
    amy.forward(100)
    amy.right(90)

    Ko‘rinib turibdiki, takrorlanadigan buyruqlarda sikl “for” operatoridan foydalanish juda qulay va kodni ancha qisqartiradi.



    11-qism


    1-savol
    Ushbu metod chaqiruvlarini ular qiladigan ish bilan moslang.
    (Hech bo‘lmaganda bittasi biroz hayratlanarli bo‘lishi mumkin!)

    Izoh: Make a really thick line. – Chiziqni qalinlashtiradi.
    Set the turtle's speed to the fastest possible. – Turtle tezligini imkon qadar oshiradi. Bunda 0 qiymat tezlikni emas, animatsiya uchun ketadigan vaqtni bildiradi, ya’ni bunda turtle holati o‘sha zumda (0 sekundda) o‘zgaradi.
    Deactivate the pen so that the turtle stops drawing when moving. – Turtle chiziq chizmaydigan qiladi – ruchkasini “ko‘tadi”.
    Activate the pen so that the turtle starts drawing when moving. - Turtle chiziq chizadigan qiladi – ruchkasini “tushiradi”.

    Download 5.67 Mb.
    1   2   3   4   5   6   7   8   9   ...   31




    Download 5.67 Mb.

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    -savol Ushbu tavsiflardan qaysi biri amy.forward(100) kod qatorini aniqlaydi? 10-qism 1-savol

    Download 5.67 Mb.