#print("Tuzuvchi Latipov Odilbek")
from turtle import*
import time
time.time()
t = Turtle()
wn = Screen()
wn.title('Soat')
wn.bgcolor('black')
wn.setup(6000,6000)
t.speed(1)
t.pensize(3)
t.hideturtle()
wn.tracer(0)
def draw_clock(h,m,s,t):
t.penup()
t.goto(0,210)
t.setheading(180)
t.pencolor("green")
t.pendown()
t.circle(210)
# soatni vaqtini belgilaymiz
t.penup()
t.goto(0,0) #markaz
t.setheading(90)
for _ in range(12):
t.forward(190)
t.pendown()
t.fd(20)
t.penup()
t.goto(0,0)
t.right(30)
# soatni minut va sek belgilaymiz
t.penup()
t.goto(0, 0) # markaz
t.setheading(90)
for _ in range(60):
t.forward(200)
t.pendown()
t.fd(10)
t.penup()
t.goto(0, 0)
t.right(6)
# soatni dizayni
# 1 raqami
t.penup()
t.goto(0,0)
t.setheading(60)
t.fd(145)
t.setheading(0)
t.fd(15)
t.write(1,move=False,align ="center",font = ("arial", 25,"normal" ))
#2 raqami
t.penup()
t.goto(0,0)
t.setheading(30)
t.fd(135)
t.setheading(0)
t.fd(35)
t.write(2, move=False, align="center", font=("arial", 25, "normal"))
# 3 raqami
t.penup()
t.goto(0, 0)
t.setheading(352)
t.fd(150)
t.setheading(0)
t.fd(25)
t.write(3, move=False, align="center", font=("arial", 25, "normal"))
# 4 raqami
t.penup()
t.goto(0, 0)
t.setheading(315)
t.fd(150)
t.setheading(0)
t.fd(45)
t.write(4, move=False, align="center", font=("arial", 25, "normal"))
# 5 raqami
t.penup()
t.goto(0, 0)
t.setheading(290)
t.fd(178)
t.setheading(0)
t.fd(25)
t.write(5, move=False, align="center", font=("arial", 25, "normal"))
# 6 raqami
t.penup()
t.goto(0, 0)
t.setheading(270)
t.fd(190)
t.write(6, move=False, align="center", font=("arial", 25, "normal"))
# 7 raqami
t.penup()
t.goto(0, 0)
t.setheading(258)
t.fd(170)
t.setheading(180)
t.fd(48)
t.write(7, move=False, align="center", font=("arial", 25, "normal"))
# 8 raqami
t.penup()
t.goto(0, 0)
t.setheading(228)
t.fd(150)
t.setheading(180)
t.fd(45)
t.write(8, move=False, align="center", font=("arial", 25, "normal"))
# 9 raqami
t.penup()
t.goto(0, 0)
t.setheading(188)
t.fd(150)
t.setheading(180)
t.fd(25)
t.write(9, move=False, align="center", font=("arial", 25, "normal"))
# 10 raqami
t.penup()
t.goto(0, 0)
t.setheading(150)
t.fd(135)
t.setheading(180)
t.fd(25)
t.write(10, move=False, align="center", font=("arial", 25, "normal"))
# 11 raqami
t.penup()
t.goto(0, 0)
t.setheading(120)
t.fd(145)
t.setheading(180)
t.fd(15)
t.write(11, move=False, align="center", font=("arial", 25, "normal"))
# 12 raqami
t.penup()
t.goto(0, 0)
t.setheading(90)
t.fd(150)
t.write(12, move=False, align="center", font=("arial", 25, "normal"))
#Soat millari
t.pu()
t.goto(0,0)
t.pencolor("red")
t.setheading(90)
angle =(h/12)*360
t.rt(angle)
t.pendown()
t.fd(80)
# minut millari
t.pu()
t.goto(0, 0)
t.pencolor("blue")
t.setheading(90)
angle = (m / 60) * 360
t.rt(angle)
t.pendown()
t.fd(120)
# sekund millari
t.pu()
t.goto(0, 0)
t.pencolor("white")
t.setheading(90)
angle = (s / 60) * 360
t.rt(angle)
t.pendown()
t.fd(160)
while True:
h=int(time.strftime("%I"))
m = int(time.strftime("%M"))
s = int(time.strftime("%S"))
draw_clock(h, m, s, t)
wn.update()
time.sleep(1)
t.clear()
mainloop()
Do you have questions for odilbek latipov?
Oshkor yoki anonim ravishda odilbek latipov ga savol berish uchun tizimga kiring.

Python soat dasturini kodlar: Bu sizlarga "Muhammadova Ferangiz" va "Ilxomov Adiz Bobi..." oldingi ikki kishilik o'yinimga layk bosganingiz uchun!!! Rahmat!!!

Sizlar uchun yana kodlar taqdim etaman hurmatli do'stlar:Tarjimai hol yaratib beradigan dastur!!!
Eslatib o'taman dastur python tilida yozilga python dasturi bo'lmasa uchbu linkdan yuklab oling :https://www.python.org/downloads/vchi:Latipov Odilbek")
#print("TuzuSizlar uchun yana kodlar taqdim etaman hurmatli do'stlar:Tarjimai hol yaratib beradigan dastur!!!
sorovnoma= input('Agar dasturga kimoqchi bo\'lsangiz \n\"yes\" yo\'qsa \"no\" deb yozing\n>>>')
if sorovnoma.title() !='Yes':
input("Vaqtingizni olganimiz uchun uzr!!!")
else:
print('a')
a= input ('Bu so\'rovnomani to\'ldirsangiz tayyor tarjimai holga ega bo\'lasiz!!!\n(enterni bosing va boshlang)\n>>>')
ism= input("Ismingizni kiriting: ")
familya= input("Familyangizni kiriting: ")
otasining_ismi=input("Otangizni ismini kiriting\n(-ovich yoki -ovna qo'shimchalari bilan yozing): ")
t_yil= int(input("Tug'ilgan yilingizni kiriting: "))
yosh= 2022 - t_yil
oila= input("Oilangizda necha kishi bor: ")
davlat= input("Davlatingiz: ")
viloyat= input("Viloyatingiz: ")
tuman= input("Tuman yoki shaharingiz nomi: ")
mahalla= input("Mahallangiz nomi: ")
qishloq= input("Qishlog'ingiz nomi: ")
hobbi= input("Yaxshi ko'rgan mashg'ulotingiz: ")
print("Yaqin do'stlaringizni ismlarini kiriting:")
ismlar=[]
n=1
while True:
savol=f"{n}-do'stingizni kiriting:"
d_ism=input(savol)
ismlar.append(d_ism)
takrorlash=input("Yana ism qo'shasizmi? (ha/yo'q)")
n+=1
if takrorlash != 'ha':
break
input(f"Mening ismim {ism.title()}.To'liq ismim {familya.title()} \n{ism.title()} {otasining_ismi.title()}.\nYoshim {yosh}da.Tug'ilgan yilim {t_yil}-yil. \nOilamda {oila} kishi bor.Men {davlat.title()} davlati,\n {viloyat.title()} viloyati {tuman.title()} tumani {mahalla.title()} \nmahallasi {qishloq.title()} qishlog'ida yashayman.\nMening hobbiyim {hobbi.title()}.\nMening eng ayqin do'stlarim/do'stim {ismlar}")
input("Hayr!!!")
print("Hayr!!!")

Do'stlar vanihoyat sizlarga pythonda yozilgan ikki kishilik o'yinimni havola etaman marhamat:
Marhamat: Yana kodlar yozib sizlarga havola etishimni istasangiz layk bosishni unitmang
from tkinter import *
import random
WIDTH = 900
HEIGHT = 300
PAD_W = 10
PAD_H = 100
BALL_SPEED_UP = 1.05
BALL_MAX_SPEED = 40
BALL_RADIUS = 30
INITIAL_SPEED = 20
BALL_X_SPEED = INITIAL_SPEED
BALL_Y_SPEED = INITIAL_SPEED
PLAYER_1_SCORE = 0
PLAYER_2_SCORE = 0
right_line_distance = WIDTH - PAD_W
def update_score(player):
global PLAYER_1_SCORE, PLAYER_2_SCORE
if player == "right":
PLAYER_1_SCORE += 1
c.itemconfig(p_1_text, text=PLAYER_1_SCORE)
else:
PLAYER_2_SCORE += 1
c.itemconfig(p_2_text, text=PLAYER_2_SCORE)
def spawn_ball():
global BALL_X_SPEED
c.coords(BALL, WIDTH/2-BALL_RADIUS/2,
HEIGHT/2-BALL_RADIUS/2,
WIDTH/2+BALL_RADIUS/2,
HEIGHT/2+BALL_RADIUS/2)
BALL_X_SPEED = -(BALL_X_SPEED * -INITIAL_SPEED) / abs(BALL_X_SPEED)
def bounce(action):
global BALL_X_SPEED, BALL_Y_SPEED
if action == "strike":
BALL_Y_SPEED = random.randrange(-10, 10)
if abs(BALL_X_SPEED) < BALL_MAX_SPEED:
BALL_X_SPEED *= -BALL_SPEED_UP
else:
BALL_X_SPEED = -BALL_X_SPEED
else:
BALL_Y_SPEED = -BALL_Y_SPEED
root = Tk()
root.title("PythonicWay Pong")
c = Canvas(root, width=WIDTH, height=HEIGHT, background="#003300")
c.pack()
c.create_line(PAD_W, 0, PAD_W, HEIGHT, fill="white")
c.create_line(WIDTH-PAD_W, 0, WIDTH-PAD_W, HEIGHT, fill="white")
c.create_line(WIDTH/2, 0, WIDTH/2, HEIGHT, fill="white")
BALL = c.create_oval(WIDTH/2-BALL_RADIUS/2,
HEIGHT/2-BALL_RADIUS/2,
WIDTH/2+BALL_RADIUS/2,
HEIGHT/2+BALL_RADIUS/2, fill="white")
LEFT_PAD = c.create_line(PAD_W/2, 0, PAD_W/2, PAD_H, width=PAD_W, fill="yellow")
RIGHT_PAD = c.create_line(WIDTH-PAD_W/2, 0, WIDTH-PAD_W/2,
PAD_H, width=PAD_W, fill="yellow")
p_1_text = c.create_text(WIDTH-WIDTH/6, PAD_H/4,
text=PLAYER_1_SCORE,
font="Arial 20",
fill="white")
p_2_text = c.create_text(WIDTH/6, PAD_H/4,
text=PLAYER_2_SCORE,
font="Arial 20",
fill="white")
BALL_X_CHANGE = 20
BALL_Y_CHANGE = 0
def move_ball():
ball_left, ball_top, ball_right, ball_bot = c.coords(BALL)
ball_center = (ball_top + ball_bot) / 2
if ball_right + BALL_X_SPEED < right_line_distance and \
ball_left + BALL_X_SPEED > PAD_W:
c.move(BALL, BALL_X_SPEED, BALL_Y_SPEED)
elif ball_right == right_line_distance or ball_left == PAD_W:
if ball_right > WIDTH / 2:
if c.coords(RIGHT_PAD)[1] < ball_center < c.coords(RIGHT_PAD)[3]:
bounce("strike")
else:
update_score("left")
spawn_ball()
else:
if c.coords(LEFT_PAD)[1] < ball_center < c.coords(LEFT_PAD)[3]:
bounce("strike")
else:
update_score("right")
spawn_ball()
else:
if ball_right > WIDTH / 2:
c.move(BALL, right_line_distance-ball_right, BALL_Y_SPEED)
else:
c.move(BALL, -ball_left+PAD_W, BALL_Y_SPEED)
if ball_top + BALL_Y_SPEED < 0 or ball_bot + BALL_Y_SPEED > HEIGHT:
bounce("ricochet")
PAD_SPEED = 20
LEFT_PAD_SPEED = 0
RIGHT_PAD_SPEED = 0
def move_pads():
PADS = {LEFT_PAD: LEFT_PAD_SPEED,
RIGHT_PAD: RIGHT_PAD_SPEED}
for pad in PADS:
c.move(pad, 0, PADS[pad])
if c.coords(pad)[1] < 0:
c.move(pad, 0, -c.coords(pad)[1])
elif c.coords(pad)[3] > HEIGHT:
c.move(pad, 0, HEIGHT - c.coords(pad)[3])
def main():
move_ball()
move_pads()
root.after(30, main)
c.focus_set()
def movement_handler(event):
global LEFT_PAD_SPEED, RIGHT_PAD_SPEED
if event.keysym == "w":
LEFT_PAD_SPEED = -PAD_SPEED
elif event.keysym == "s":
LEFT_PAD_SPEED = PAD_SPEED
elif event.keysym == "Up":
RIGHT_PAD_SPEED = -PAD_SPEED
elif event.keysym == "Down":
RIGHT_PAD_SPEED = PAD_SPEED
c.bind("<KeyPress>", movement_handler)
def stop_pad(event):
global LEFT_PAD_SPEED, RIGHT_PAD_SPEED
if event.keysym in "ws":
LEFT_PAD_SPEED = 0
elif event.keysym in ("Up", "Down"):
RIGHT_PAD_SPEED = 0
c.bind("<KeyRelease>", stop_pad)
main()
root.mainloop()