محاسبه حجم مکعب مستطیل
برنامه ای بنویسید که طول و عرض و ارتفاع مکعب مستطیلی را دریافت کند و حجم آن را محاسبه کند
حجم مکعب مستطیل = طول * عرض * ارتفاع
برنامه ای بنویسید که طول و عرض و ارتفاع مکعب مستطیلی را دریافت کند و حجم آن را محاسبه کند
حجم مکعب مستطیل = طول * عرض * ارتفاع
a:int(input("Width:")
b:int(input("Height:")
c:int(input("Length:")
h:(a*b*c)
print(h)
def hajm(a , b, c) :
return a * b * c
a = int(input('tool :'))
b = int(input('arz :'))
c = int(input('ertefa :'))
print('hajm mostatil:',hajm(a , b ,c))
print("Hello,this is your program")
class Volume_of_rectangular_cube:
def __init__(self , Volume):
self.Volume = Volume
list = []
txt = input("1.Volume 2.see_list 3.remove_list\n")
try:
while True:
if txt == "1":
a = float(input("Enter width:"))
b = float(input("Enter height:"))
c = float(input("Enter lenght:"))
Volume = ( a * b * c )
list.append(Volume)
print("result is:",Volume)
s = input("Do you want to continue(y|N):")
if s == "y":
txt = input("1.Volume 2.see_list 3.remove_list\n")
else:
if s == "N":
break
if txt == "2":
print(list)
s = input("Do you want to continue(y|N):")
if s == "y":
txt = input("1.Volume 2.see_list 3.remove_list\n")
else:
if s == "N":
break
if txt == "3":
list.remove(Volume)
print(list)
s = input("Do you want to continue(y|N):")
if s == "y":
txt = input("1.Volume 2.see_list 3.remove_list\n")
else:
if s == "N":
break
except:
print("Error")
print("Good bye")
try:
print("This is a volume of traingle program")
class Volume:
def __init__(self , area , environment , volume ):
self.area = area
self.environment = environment
self.volume = volume
def Check_point(self):
if txt == "":
print("Error")
list = []
while True:
txt = input("1.area 2.environment 3.volume 4.list 5.remove_area 6.remove_environment 7.remove_volume n.exit\n")
if txt == "1":
lenght = float(input("Enter lenght of shape(cm):"))
width = float(input("Enter width of shape(cm):"))
area = ( lenght * width )
list.append( area )
print( area )
PI = input("Do you want to Continuation(y|N)\n")
if PI == "y":
txt = input("1.area 2.environment 3.volume 4.list 5.remove_area 6.remove_environment 7.remove_volume n.exit\n")
else:
if PI == "N":
break
if txt == "2":
lenght = float(input("Enter lenght of shape:"))
width = float(input("Enter width of shape:"))
environment = ( lenght + width ) * ( 2 )
list.append( environment )
print( environment )
PI = input("Do you want to Continuation(y|N)\n")
if PI == "y":
txt = input("1.area 2.environment 3.volume 4.list 5.remove_area 6.remove_environment 7.remove_volume n.exit\n")
else:
if PI == "N":
break
if txt == "3":
lenght = float(input("Enter lenght of shape:"))
width = float(input("Enter width of shape:"))
height = float(input('Enter height of shape:'))
volume = ( lenght * width * height )
list.append( volume )
print( volume )
PI = input("Do you want to Continuation(y|N)\n")
if PI == "y":
txt = input("1.area 2.environment 3.volume 4.list 5.remove_area 6.remove_environment 7.remove_volume n.exit\n")
else:
if PI == "N":
break
if txt == "4":
print( list )
if txt == "5":
remove_area = input("Select your item for remove :")
list.remove( area )
print( list )
PI = input("Do you want to Continuation(y|N)\n")
if PI == "y":
txt = input("1.area 2.environment 3.volume 4.list 5.remove_area 6.remove_environment 7.remove_volume n.exit\n")
else:
if PI == "N":
break
if txt == "6":
remove_environment = input("Select your item for remove :")
list.remove( environment )
print( list )
PI = input("Do you want to Continuation(y|N)\n")
if PI == "y":
txt = input("1.area 2.environment 3.volume 4.list 5.remove_area 6.remove_environment 7.remove_volume n.exit\n")
else:
if PI == "N":
break
if txt == "7":
remove_volume = input("Select your item for remove:")
list.remove( volume )
print( volume )
PI = input("Do you want to Continuation(y|N)\n")
if PI == "y":
txt = input("1.area 2.environment 3.volume 4.list 5.remove_area 6.remove_environment 7.remove_volume n.exit\n")
else:
if PI == "N":
break
if txt == "n":
print("Good bye,see you later:)")
break
except:
print("Error,you can try again:)")
tool=int(input("tool: "))
arz=int(input("arz: "))
ertefa=int(input("ertefa: "))
print(tool*arz*ertefa))
x, y, z = input("Enter length, width and height:").split() x , y , z = float(x) , float(y) , float(z) print(x*y*z)
print("Hi welcome") a = int(input("what is number of length?")) b = int(input("what is number of width?")) c = int(input("what is number of height?")) print("volume of cube is:" , a*b*c)
L = int(input("length: "))
W = int(input("Width : "))
H = int(input("Higher: "))
print(L * W * H, 'The volume of the rectangle')
def Volume(): H=int(input('enter height: ')) L=int(input('enter length: ')) W=int(input('enter width: ')) return f'{H*W*L} = Volume of cube' print(Volume())
t=float(input('tool : ')) a=float(input('arz : ')) e=float(input('ertefa : ')) print('volume : tool*arz*ertefa = {} '.format(t*a*e))
برنامه ای بنویسید که 2 تاریخ به فرمت yyyy/mm/dd دریافت کند و فاصله 2 تاریخ را به روز در خروجی چاپ کند مثالtarikh1: 1401/11/01 tarikh2: 1401/11/05 4 days tarikh1: 1401/10/01 tarikh2: 1401/11/05 34 days
برنامه ای بنویسید که مساحت مربعی را از کاربر دریافت کند و اندازه هر ضلع را در خروجی چاپ کند
برنامه ای بنویسید که یک تاریخ شمسی را از ورودی (به فرمت yyyy/mm/dd) دریافت کند. سپس تاریخ را به میلادی تبدیل کرده و در خروجی چاپ کند
کلاسی بنویسید که طول، عرض و ارتفاع مکعب مستطیل را دریافت کند و مساحت و حجم آن را با استفاده از متدهای مختلف محاسبه کند
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام
اگه متوجه تمرین نمیشی یا به هر دلیلی نمیتونی حلش کنی، کاملا طبیعیه، اشکالی نداره؛ ناراحت نشو
😊
سعی کن تمرینات آسون تر رو ببینی و جواب های مختلفی که دیگران ارسال کرده اند رو بررسی کنی و
یواش یواش به سراغ تمرینات سخت تر بری.
همچنین ممکنه جوابت درست باشه ولی با سایر جواب ها متفاوت باشه
اگه برنامه نویسی رو هنوز شروع نکردی یا خوب یاد نگرفتی، میتونی از طریق لینک زیر یاد بگیری