Ushbu ishchi о‘quv dasturiga tinglovchilarning talab va ehtiyojlarini о‘rganish asosida mavzular kiritilgan bо‘lib, Informatika fanlarini о‘qitish sifati va samaradorligini yanada oshirish nazarda tutilgan



Download 6,01 Mb.
bet51/75
Sana07.04.2022
Hajmi6,01 Mb.
#535541
1   ...   47   48   49   50   51   52   53   54   ...   75
Bog'liq
Dasturlash asoslari Vizualizatsiya va Python dasturlash tillarini

Dasturi:

Natijasi:

import turtle #tashqi
wn = turtle.Screen()
wn.bgcolor("light green")
wn.title("Turtle")
t = turtle.Turtle()
t.color("blue")
def sqrfunc(size):
for i in range(4):
t.fd(size)
t.left(90)
size = size-5
dlina = 146
while dlina > 6:
sqrfunc(dlina)
dlina = dlina - 20
wn.mainloop()





3-misol. Python dasturlash tilida fon rangi qizil va yashil rangdagi siniq chiziqlardan faoydalangan holda daraxt shaklini hosil qiluvchi dastur tuzing.



Dasturi:

Natijasi:

import turtle as tu
t = tu.Turtle()
t.screen.bgcolor('red')
t.left(90)
t.speed(20)
t.color('green')
t.pensize(5)
t.screen.title("My Fractal Tree")
def draw_fractal(blen):
if(blen<10):
return
else:
t.forward(blen)
t.left(30)
draw_fractal(3*blen/4)
t.right(60)
draw_fractal(3*blen/4)
t.left(30)
t.backward(blen)
draw_fractal(80)
t = tu.done()





4-misol. Python dasturlash tilida ko’k rangdagi aylanan hosil qiluvchi dastur tuzing. Shakl chiziqni chizishda toshbaqa yordamida hosil qiling.



Dasturi:

Natijasi:

import turtle
window = turtle.Screen()
t = turtle.Turtle()
t.shape('turtle')
t.color('blue')
t.circle(100)
#window = turtle.Screen()
window.mainloop()




5-misol. Python dasturlash tilida turli xil rangdagi uchburchaklar hosil qiluvchi dastur tuzing. Shakl chiziqni chizishda toshbaqa yordamida hosil qiling.

Dasturi:

Natijasi:

from turtle import *
shape("turtle")
wheel=12
bgcolor("blue")
pensize(10)
pencolor("red")
goto(100,0)
for i in range(wheel):
begin_fill() ;
rt (90)
fd(200)
lt(120)
fd (200)
lt(120)
fd (200)
end_fill()
fd (200)
exitonclick()





6-misol. Python dasturlash tilida turli xil rangdagi kvadratlar hosil qiluvchi dastur tuzing.



Dasturi:

Natijasi:

from turtle import *
from random import randint
speed(0)
bgcolor('black')
x = 1
while x <= 400:
r = randint(0,255)
g = randint(0,255)
b = randint(0,255)
colormode(255)
pencolor(r,g,b)
fd(50 + x)
rt(90.91)
x = x+1
exitonclick()





7-misol. Python dasturlash tilida atirgul rasmini hosil qiluvchi dastur tuzing. Shakl chiziqni chizishda toshbaqa yordamida hosil qiling. Shakl chiziqni chizishda toshbaqa yordamida hosil qiling.

Dasturi:

from turtle import*
speed(10)
shape("turtle")
bgcolor("black")
pencolor("gray");pensize(40);circle(100, 360);rt(90);circle(130, 360); rt(90);circle(100,360);rt(90);circle(130,360)
pencolor("white");pensize(34);circle(160,360);rt(90);circle(160,360); rt(90);circle (160,360);rt (90);circle(160, 360)
pencolor("brown");pensize(28);circle(110,360);rt(90);circle(140,360); rt(90);circle(140,360);rt(90); circle(110,360)
pencolor("red");pensize(25);circle (120,360);rt(90);circle(120,360); rt(90);circle(120,360);rt(90);circle(120,360)
pencolor ("blue" ); pensize(20); circle(100, 360); rt(90); circle(100,360); rt(90);circle(100,360);rt(90);circle(100,360)
pencolor("yellow");pensize(15);circle(80,360);rt(90);circle(80,360); rt(90);circle(80,360);rt(90);circle(80,360)
pencolor("Aqua");pensize(10);circle(60,360);rt(90); circle(60,360); rt(90); circle(60,360);rt(90);circle(60,360)
pencolor("red");pensize(5);circle(43,360);rt(90);circle(40,360); rt(90);circle(40, 360);rt(90);circle(40,360)
pencolor("white");pensize(2);circle(20,360);rt(90);circle(20,360); rt(90);circle(20, 360);rt(90);circle(20,360)
exitonclick()





8-misol. Python dasturlash tilida turli xil rangdagi aylanalardan pufakchalar hosil qiluvchi dastur tuzing.




Download 6,01 Mb.

Do'stlaringiz bilan baham:
1   ...   47   48   49   50   51   52   53   54   ...   75




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

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish