Pythonda ma’lumot turlari bilan ishlash Dars shakli: amaliy


Quyidagi dasturlarni bajaring


Download 317.09 Kb.
bet8/8
Sana09.10.2023
Hajmi317.09 Kb.
#1695881
1   2   3   4   5   6   7   8
Bog'liq
Pythonda ma\'lumot turlari bilan ishlash (2)

Quyidagi dasturlarni bajaring:



  • Foydalanuvchining yoshini so'rab, uning tug'ilgan yilini hisoblab, konsolga chiqaruvchi dastur



  • Foydalanuvchidan ikki son kiritshni so'rab, kiritilgan sonlarning yig'indisi, ayirmasi, ko'paytmasi va bo'linmasini chiqaruvchi dastur





Bayroq.






import turtle
turtle.left(90)
turtle.begin_fill()
turtle.fillcolor("blue")

turtle.right(90)


turtle.forward(300)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(300)
turtle.right(90)
turtle.forward(50)

turtle.end_fill()


turtle.backward(50)


turtle.begin_fill()
turtle.fillcolor('white')
turtle.right(90)
turtle.forward(300)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(300)
turtle.right(90)
turtle.forward(50)

turtle.end_fill()


turtle.backward(50)


turtle.begin_fill()
turtle.fillcolor('green')

turtle.pencolor('black')
turtle.right(90)
turtle.forward(300)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(300)
turtle.right(90)
turtle.forward(50)

turtle.end_fill()


turtle.right(90)


turtle.begin_fill()
turtle.pencolor("red")
turtle.forward(300)

turtle.left(90)


turtle.begin_fill()
turtle.pencolor("black")
turtle.forward(50)

turtle.left(90)


turtle.begin_fill()
turtle.pencolor("red")
turtle.forward(300)

turtle.end_fill()



Download 317.09 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling