Python class jahad
14 subscribers
2 photos
6 files
4 links
Download Telegram
برنامه تشخيص تعداد روزهاي ماه هاي سال 👇:
#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
برنامه چاپ مقسوم عليه هاي يك عدد دريافتي 👇:
#maghsoom aleyh
#15: 1 3 5 15
#28:1 2 4 7 14 28
num1=int(input("please enter a number:"))
for i in range(1,num1+1,1):
if num1%i==0:
print(i)
👍2
برنامه چاپ پنج سطر كاراكتر 👇:
#tarsim ************
for i in range(1,5,1):
print("*$*$*$")
👍2
برنامه چاپ مربع تو پر 👇:
#tarsim moraba to por
for i in range(1,11,1):#roye satr
for j in range(1,11,1):#roye soton
print("*",end=" ")
print()
👍2
برنامه چاپ جدول ضرب ١٠ *١٠ 👇: