تمرین برنامه نویسی؛ با کدبزن!

منبع جامع سوالات و تمرینات برنامه نویسی

1
+1

محاسبه حجم مکعب مستطیل

کاربر 1054 آسان 324/ دانلود 785 بازدید

برنامه ای بنویسید که طول و عرض و ارتفاع مکعب مستطیلی را دریافت کند و حجم آن را محاسبه کند

حجم مکعب مستطیل = طول * عرض * ارتفاع

10 جواب

نمیتونم این تمرین رو حل کنم!
1
+1
a:int(input("Width:")
b:int(input("Height:")
c:int(input("Length:")
h:(a*b*c)
print(h)
کاربر 1085 دانلود Python
1
+1
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)) 
Rtmobin دانلود Python
0
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")

کاربر 775 دانلود Python
0
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:)")
کاربر 775 دانلود Python
0
tool=int(input("tool: "))
arz=int(input("arz: "))
ertefa=int(input("ertefa: "))
print(tool*arz*ertefa))
کاربر 1148 دانلود Python
0
x, y, z = input("Enter length, width and height:").split()
x , y , z = float(x) , float(y) , float(z) 
print(x*y*z)
کاربر 1282 دانلود Python
0
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)
کاربر 1454 دانلود Python
0
L = int(input("length: "))
W = int(input("Width : "))
H = int(input("Higher: "))
print(L * W * H, 'The volume of the rectangle')
کاربر 1546 دانلود Python
0
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())
Knowledgebiome دانلود Python
0
t=float(input('tool : '))
a=float(input('arz : '))
e=float(input('ertefa : '))


print('volume : tool*arz*ertefa = {} '.format(t*a*e))
Soheyl دانلود Python

ارسال جواب

// کداتو توی این بخش بنویس
// فرقی نمیکنه چه زبان برنامه نویسی باشه، همرو پشتیبانی میکنیم :)
// البته قبلش این سه خط رو پاک کن


  • تو جوابت میتونی از تصویر، کد، لینک به سایر صفحات و... استفاده کنی
  • لطفا جواب های تکراری ارسال نکن
  • جواب های ارسالی، پس از بررسی کوتاهی، ویرایش میشن و در سایت نمایش داده میشن
  • ارسال جواب حق مادی یا معنوی برای ارسال کننده ایجاد نمیکند و تمام حقوق برای سایت کدبزن محفوظ است

تمرینات مرتبط

تشخیص با استفاده از هوش مصنوعی
×
×
بستن