Python class jahad
14 subscribers
2 photos
6 files
4 links
Download Telegram
#tashkhis mosalas ghaemozavieh
a=int(input("please enter a:"))
b=int(input("please enter b:"))
c=int(input("please enter c:"))
if a**2==b**2+c**2 or b**2==c**2+a**2 or c**2==a**2+b**2:
print("Right Triangle")
else:
print("Not Right Triangle")
👍1
برنامه ترسيم شش ضلعي رنگارنگ 👇:
import turtle
colors=['yellow','blue','red','purple','green','orange']
t=turtle.Pen()
turtle.bgcolor('black')
for x in range(360):
t.pencolor(colors[x%6])
t.width(x/100+1)
t.forward(x)
t.left(59)
👍2
برنامه هاي جلسه چهارم؛ ١٤٠٢/٠٥/٢٢ 👇:
برنامه تشخيص روز هفته 👇:
#tashkhis rooz hafteh
x=int(input("please enter a number:"))
if x==1:
print("Sat")
elif x==2:
print("Sun")
elif x==3:
print("Mon")
elif x==4:
print("Tue")
elif x==5:
print("Wed")
elif x==6:
print("Thu")
elif x==7:
print("Fri")
else:
print("please enter number between 1 and 7")
👍1
برنامه تشخيص عدد مثبت ؛ منفي و صفر 👇:
#tashkhis adad mosbat manfi sefr
a=float(input("please enter a number:"))
if a>0:
print("Positive")
elif a==0:
print("Zero")
else:
print("Negative")
👍1
برنامه تشخيص تعداد روزهاي ماه هاي سال 👇:
#tashkhis roozhaye mah
y=int(input("please enter a number:"))
if 1<=y<=6:
print("31 Days")
elif 7<=y<=11:
print("30 Days")
elif y==12:
print("29 Days")
else:
print("please enter number between 1 and 12")
👍1
برنامه نمره دهي توصيفي پايه ابتدايي 👇:
x=float(input("please enter a number:"))
if 17<=x<=20:
print("Kheyli khoob")
elif 15<=x<17:
print("khob")
elif 12<=x<15:
print("ghabel ghabool")
elif 0<=x<12:
print("Niaz be talash bishtar")
else:
print("LotfaN ADADi beyn 0 ta 20 vared konid:")
👍1
برنامه ترسيم مربع از داخل 👇:
#morab az ma4rkaz
import turtle

t=turtle.Pen()
turtle.bgcolor('black')
dist=0.35
for i in range(2):
t.pencolor("white")
t.forward(dist)
t.rt(90)
dist=dist+0.5
👍1
برنامه هاي جلسه پنجم؛ ١٤٠٢/٠٥/٢٤ 👇:
برنامه بازي سنگ؛ كاغذ ؛ قيچي👇:
#Bazi Sang Kaghaz gheychi
#sang==>S kaghaz==>K gheychi==>G
p1=input("Player 1 lotfan sang:S kaghaz:K gheychi:G ")
p2=input("Player 2 lotfan sang:S kaghaz:K gheychi:G ")
if p1==p2:
print("player1 and player 2 mosavi")
elif p1=="S" and p2=="G":
print("player1 barandeh shod")
elif p1=="K" and p2=="S":
print("player1 barandeh shod")
elif p1=="G" and p2=="K":
print("player1 barandeh shod")
elif p2=="S" and p1=="G":
print("player2 barandeh shod")
elif p2=="K" and p1=="S":
print("player2 barandeh shod")
elif p2=="G" and p1=="K":
print("player2 barandeh shod")
else:
print("lotfan faghat S G K ra entekhab konid")
👍2
برنامه چاپ اعداد ١ تا ١٠ 👇:
#for
#1 2 3 4 5 6 7 8 9 10
for i in range(1,11,1):
print(i)
👍2
برنامه چاپ اعداد زوج ٢ تا ١٠٠٠٠٠ 👇:
#for
#2 4 6 8 10 12 14 16 ,
for i in range(2,100001,2):
print(i)
👍2