محاسبه مساحت مستطیل
برنامه ای بنویسید که طول و عرض مستطیلی را از ورودی دریافت کند و مساحت آن را در خروجی چاپ کند
برنامه ای بنویسید که طول و عرض مستطیلی را از ورودی دریافت کند و مساحت آن را در خروجی چاپ کند
a = int(input("length: ")
b = int(input("width: ")
print(a * b)
پرانتزها بسته نشده خطا میده
a= float(input("salam lotfan tole mostatil ra vared kunid:"))
b= float(input("lotfan arze mostatil ra vared kunid:"))
print(f"masahate mostatil {a*b} ast")
a = float(input('tool:'))
b = float(input('arz:'))
print(float(a*b))
float تو پایتون به معنای عدد اعشاریه که...اگه int میزدی بهتر نبود؟
وقتی از float استفاده میشه نتیجه دقیقتر خواهد بود
l= int(input("length: "))
w= int(input("width: "))
area = l*w
print(f"The area is: {area}")
Tol = int(input("tol : ")) Arz = int(input("arz : ")) print(Arz * Tol)
print('mohasebe masahat mostatil') length=float(input('tool: ')) width=float(input('arz: ')) print('masahat mostatil: ',(length*width))
a = input('tool: ') b = input('arz: ') result = int(a) * int(b) print(result)
✌️
L=int(input(Length: )) W=int(input(width: )) print(L*W)
a = input("Enter a number tul: ") a = int(a) b = input("Enter a number arz: ") b = int(b) c = a*b f = (a + b) /2 print(c) print(f)
a = input("length:")
b = input("width:")
print(int(a) * int(b))
tol = int(input("tol mostatil: ")) arz = int(input("arz mostatil: ")) mas = tol * arz print("masahat mostatil=", mas)
X = int(input("enter x: ") Y = int(input("enter y: ") Print(X * Y)
lenght = int(input('Enter your a lenght: '))
width = int(input('Enter your a width: '))
area = lenght * width
print(f 'area is : {area}')
1 = input(lenght) 2 = input(width) print(1*2)
این باید int بشه اگر اشتباه نکنم.
l = float(input('Enter the length : ') w = float(input('Enter the width : ') print(l * w)
# مساحت مستطیل a = input("aez:") b = input("tool:") a = float(a) b = float(b) print(a*b)
میتونستی فلوت ها رو مستقیم ضرب در هم کنی
lengh = int(input('size of lengh: ')) width = int(input('size of width: ')) area = lengh*width print('Area is',area)
the_length = float(input("length of the rectangle: ")) width = float(input("the width of the rectangel: ")) answer = the_length * width print(answer)
lenght = int(input("Please Enter lenght: "))
width = int(input("Please Enter width: " ))
print('----------------------')
result = lenght * width
print(f'Rectangle area is: {result}')
a = int(input("length :"))
b = int(input("width : "))
c = a * b
Print(c)
x = float(input("enter tool: "))
y = float(input("enter arz: "))
c = float(x) * float(y)
a = str(c)
print("S = " + a)
print("welcome")
input("masahat mostatil ra hesab mikoni?")
a =input("tol")
b =input("arz")
a=int(a)
b=int(b)
print(a*b)
Arz=input("arz")
Toul=input("Toul")
Arz=int(arz)
Toul=int(Toul)
Print(Arz*Toul)
a=int(input("tool:")) b=int(input("arz:")) area= a*b print(area)
tool = int(input('enter tool: '))
arz = int(input('enter arz : '))
print('masahat = ',tool * arz)
a = int ( input ("tool ")) b = int ( input ("arz")) c = a * b print (c)
arz=int(input("arz:")) tool=int(input("tool:")) print(arz * tool)
a = input ("arz mostatil:") b = input ("tool mostatil:") masahat = int(a)* int(b) print("masahat mostatil =", masahat)
a=int(input('enter length:')) b=int(input('enter width:')) print(a*b)
def area(lenght:int, width:int): '''the return area is the rectangle''' arae = lenght * width return arae lenght = int(input('Enter your a lenght: ')) width = int(input('Enter your a width: ')) print(area(lenght, width))
# طول = a عرض = b a = int (input("length of the rectangle :")) b = int (input("the width of the rectangle :")) print( a * b )
a = int(input("طول مسطتیل:")) b = int (input("عرض مسطتیل:")) print(a * b)
x = int(input())
y = int(input())
print(x * y)
tool= int (input("enrter tool:...")) arz= int (input("enter arz:...")) a=(tool*arz) print(a)
a=int(input(' enter lengthe: ')) b=int(input(' enter width: ')) masahat=a*b print(masahat)
tol = float (input("tol :") arz = float (input ("arz":) result = tol*arz Print (result)
length=input("Enter Length : ") width=input("Enter Width : ") print(length*width)
lengs = float(input('lotfan tool ra vared konid : ')) width = float(input('lotfan arz ra vared konid :')) print(lengs * width)
print(int(input())*int(input()))
tol = float(input('tol: '))
arz = float(input('arz: '))
mostatil = [ tol , arz ]
print( ( mostatil[0] ) * ( mostatil[1] ) )
# area function
def area(length:int , width:int) :
return length * width
# get and check width
width = int(input("inter width : "))
while(width <= 0) :
width = int(input("[ invalid ] inter width again : "))
# get and check length
length = int(input("inter length : "))
while(length <= 0) :
length = int(input("[ invalid ] inter length again : "))
result = area(length , width)
print(f"{'*' * 8}\n The Area Is : {result} \n{'*' * 8} ")
val tol = readLine()!!.toInt() val arz = readLine()!!.toInt() println(tol*arz)
a=float(input("adade aval(tool) ra vared konid:"))
b=float(input("adade dovom(arz) ra vared konid:"))
area = a*b
print("masahat mostatil:",area)
width = int(input("please enter width(tool) : "))
height = int(input("please enter height(arz) : "))
Area = width * height
print('output: ', Area)
a= input("tool ra vared konid:") b= input("aarz ra vared konid:") c=int(a) d=int(b) print(("masahat="),(c*d)) print("moheet=",2*(c+d))
#این کد برای محسابه مساحت مستطیل است A = float(input("Enter arz = ")) B = float (input ("Enter tol= ")) print(A * B)
a =int(input('arz:'))
b =int(input('tol:'))
resuls=int(a) *int(b)
print(resuls)
a =int(input("tol:")) b =int(input("masahat:")) c =(a * b) print(c)
n=input("tool") u=input("arz") print(n*u)
tool=input(f'tool mostatil ra vared konid : ') arz=input(f'arz mostatil ra vared konid : ') masahat=int(tool)*int(arz) print(f'masahate mostatil barabar ast ba {masahat} ')
a = float(input('a :')) b = float(input('b :')) print('s = '.format(a * b))
a= int(input("tool :")) b=int( input("areze :")) print(a,b) print(a*b)
h,w = map(int, input('inter number (h,w) :').split(',')) print(h*w)
Number1 = int(input(" Type Your Number1: ") Number2 = int (input("Type Your Number2: ") Print(Number1 * Number2)
l=float(input('lenght:') w=float(input('width:') print(l*w)
tool=int(input('tool: ')) arz=int(input('arz: ')) print('masahat tool * arz =',tool*arz )
Length =int (input("plese ipnut length of the rectangle: "))
width =int (input("plese input width of the rectangle: "))
# Length* width
print(Length * width)
great
x = int(input("write a length:")) y = int(input("write a width:")) print("answer:",x*y)
x = int(input("What's the width ? ")) y = int(input("What's the length?")) print (x*y)
a = int(input(tool mostatil ra vared konid: ))
b = int (input(arz ra vared konid: ))
print(a*b)
print(float(input('Enter Tol : '))*float(input('Enter Arz : ')))
def mostatil (tool, arz):
return tool * arz
def main ():
tool = int(input('Enter Tool : ')
arz = int(input('Enter arz : ')
print('masahat mostatil = ' , mostatil(tool, arz))
main()
tool=float(input("toole:"))
arz=float(input("arz"))
print("tool"*"arz")
a=int(input(' enter tool ')) B=int(input(' enter arz ')) Print(a*B)
tool =int (input ("tool che ghadre?"))
arz = int (input ("arz che ghadre?"))
print(arz*tool)
print("welcom")
tool=float(input("enter a num: ")
arz=float(input("enter a num: ")
print(f" masahat ba tool{tool} * arz {arz}=", tool*arz)
while True:
length = int(input("enter the length: "))
offer = int(input("enter the offer: "))
print(length * offer)
Console.WriteLine("Please Enter length of the rectangle :");
int Number_length = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Please Enter width of the rectangel :");
int Number_width = Convert.ToInt32(Console.ReadLine());
int rectangle_area = Number_length * Number_width;
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("*******************************************************************");
Console.ResetColor();
Console.WriteLine("The area of the rectangle is equal to :");
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine(rectangle_area);
Console.ResetColor();
Console.ReadKey();
print('mohasebe masahat mostatil') A=input('Tool ra vard konid : ') B=input('Arz ra vard konid : ') A=float(A) B=float(B) print(A*B)
let length = prompt("طول مستطیل را بنویسید");
let width = prompt("عرض مستطیل را بنویسید");
rectangle = length * width;
console.log(rectangle);
lenght = float ( (input :" lenght" )) width= float ( (input :" width" )) print : ( " lenght * width )
width = int(input("enter Width: ")) height = int(input("enter Height")) area = width * height print(f"Width: {width}\nHeight: {height}\nArea is: {area} ")
print("mohasbe masahat mostatil") #============//code//=========# a = int(input("arz: ")) b = int(input("tol : ")) c = ( a * b ) print("kilometr : {}".format(c))
m = int (input('m:'))# طول مستطیل است m n = int(input('n:'))# عرض مستطیل است n print(m * n)
tol = int(input("what is your tol: "))
arz = int(input("what is your arz: "))
print(tol * arz)
a=eval(input("width:")) b=eval(input("height:")) print(a*b)
x= float(input('tool:'))
y= float(input('arz:'))
masahat = x*y
print('masahat=',masahat)
def area():
lenght = int(input("Enter length:"))
width = int(input("Enter width:"))
result = lenght * width
print(f"area--> {result}")
area()
A = float(input("tool": ) B = float(input("arz" : ) Print(A * B)
tol= int(input("toll: "))
arz= int(input("arz: "))
m= (tol * arz)
print ("masahat= ", m)
print("To get the perimeter of the rectangle, you need to enter the length and width.") a = int(input("length:")) s = int(input("width:")) d = a * s print ("rectangle area:", d)
print("<< Hello im here tu calculat the area of the rectangle for you so lets do it >> ")
Length = float(input("Please enter length of the rectangle : "))
Width = float(input("Please enter width of the rectangle : "))
print("The area of the rectangle is = " , Length * Width)
quit = input("Press ENTER to close")
a = int(input("arz: ") b = int(input(" tool: ") print(a*b)
s = int(input("Enter the s: ")) p = int(input("Enter the p: ")) print(s * p)
# Enter Tol Mostatil tol = int(input("طول مستطیل را وارد کنید: ")) # Enter Arz Mostatil arz = int(input("عرض مستطیل را وارد کنید: ")) print(tol * arz)
a =float(input("the width of the rectangel:"))
b = float(input("length of the rectangle:"))
print(a*b)
print("masahat mostatil")
Tol = int(input("tol : "))
Arz = int(input("arz : "))
print("javab : ",Arz * Tol)
tol = int (input("طول مستطیل را وارد کنید")) arz=int (input("عرض مستطیل را وارد کنید")) print( tol * arz )
print("To calculate the area of the rectangle:")
a=int(input("Please enter the length of the rectangle"))
b=int(input("Please enter the width of the rectangle"))
area=str(a*b)
print("The area of your rectangle is:",area)
width = float(input("width:"))
length = float(input("length:"))
print(width * length)
a=input(lenght)
b=input(wight)
result=input(a*b)
print=result
int(result=masahate mostatil)
# part one => easy :
theWidth = 5
theHeight = 6
area = theWidth * theHeight
print(area)
print("=====================================================")
# part two => medium :
width = int(input(" please enter the width of the rectangle:"))
length = int(input(" please enter the length of the rectangle:"))
print(f"the area of the rectangle is {width * length}")
print("=====================================================")
# part three => hard :
def areaOfRectangle(width,length):
sum = width * length
return sum
print(areaOfRectangle(5,6))
t = int(input("tool: "))
a = int(input("arz: "))
print("macahat: ",a*t)
print("mohit: ",(a+t)*2)
Tol = float(input("Tol Mostatil Ra Vared Konid: ")
Arz = float(input("Arz Mostatil Ra Vared Konid: ")
Print (Tol*Arz)
tool= float(input("tool : ")) arz= float(input('arz : ')) masahat= tool*arz print('masahate mostatil = {} × {} = {}'.format(tool,arz,masahat))
a=int(input("Rectangle length: "))
b=int(input("Rectangle width: " ))
c= a*b
print("s:", c)
tol = input('enter tol: ') arz = input('enter arz: ') s = tol*arz print('masahat = '+s)
tool = int and float(input("Tool: ")) arz = int and float(input("Arz : ")) masahat = print(f"Masahat : {tool * arz}")
tool = eval(input("tool ra vared konid:")) arz = eval(input("arz ra vared konid:")) a = tool * arz print(a)
print("Program for calculating the area of a rectangle")
Length =float(input("write your length : "))
Width =float(input("write your Width : "))
print(f"The area of the rectangle you want is : {Length*Width}")
a = int(input("Enter the length of the rectangle: ")) b = int(input("Enter the width of the rectangle: ")) print("rectangle area :" , a*b)
tool=int(input("tool ra vared konid : ")) arz=int(input("arz ra vared konid : ")) masahat = tool * arz print(masahat)
a=int(input("length ")) b=int(input("width ")) print("area : " , a*b)
x = int(input("طول مستطیل را وارد کنید: "))
y = int(input("عرض مستطیل را وارد کنید: "))
a = x * y
print("مساحت مستطیل برابر است با" + " " + str(a))
print(" Enter number for ,a= لوط b=ضرع ") a=int(input("a= ")) b=int(input("b= ")) masahat=a*b mohit=(a+b)*2 print( "masahat={} , mohit={} ".format(masahat,mohit))
name = int(input("tool:"))
names = int(input("arz:"))
result = name * names
print("javab:",result)
const length = prompt("please Enter Length:");
const width = prompt("please Enter Width: ");
console.log(`areaTheCircle: ${length * width}`);
tool = float(input("Enter your number: ")) arz = float(input("Enter your number: ")) x = tool*arz print("area is {}".format(x))
tool = int(input('enter tool: ')) arz=int(input('enter arz: ')) def masahat_mostatil(tool,arz): finallY=tool*arz return finallY print(masahat_mostatil(tool=tool,arz=arz))
a = input("width: ")
a =int(a)
b = input("length: ")
b =int(b)
print("answer=",a*b)
t = int(input('please enter lentgh : ')) a = int(input('please enter width : ')) s = t * a print(s)
length=float(input('length:'))
width=float(input('width:'))
print(length*width)
a = float(input("tol mostatil")) b = float(input("arz mostatil")) print(a*b)
x = float(input("toolesh chande? ")) y = float(input("arzesh chande? ")) masahat = x * y print(masahat)
a = int(input("arz mostatil : ")) b = int(input("tol mostatil : ")) c = a * b print (c)
tool=int(input("tool=")) arz=int(input("arz=")) masahat=tool*arz print(masahat)
int(input("enter the length of the rectangel :"))
y = int(input("enter the width of the rectangel :"))
p = x + y
p = p * 2
print("the perimeter is : " , p )
a = x * y
print("the area is : " , a )
برنامه ای بنویسید که عددی را از ورودی دریافت کند و بررسی کند که عدد بر 5 بخش پذیر است یا خیر؟ راهنمایی: عددی بر 5 بخش پذیر است که باقی مانده تقسیم آن بر 5 صفر شود
برنامه ای بنویسید که اسم و شماره دانشجویی کاربران را دریافت کند و در یک فایل به اسم students.txt ذخیره کند. همچنین بعد از هر ذخیره سازی، کل اطلاعات این فایل را در خروجی نمایش دهید.
برنامه ای بنویس که همانند یک تاس، با هر بار اجرا، یک عدد تصادفی بین 1 تا 6 در خروجی چاپ کند
برنامه ای بنویس که با توجه به فرمول زیر شاخص توده بدنی / BMI فرد را بدست آورد و با توجه به اطلاعاتی که در ادامه آمده است وضعیت فرد را نمایش دهدBMI = w / h * hفرمول = وزن تقسیم بر توان دوم قد BMI کم...
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام
اگه متوجه تمرین نمیشی یا به هر دلیلی نمیتونی حلش کنی، کاملا طبیعیه، اشکالی نداره؛ ناراحت نشو
😊
سعی کن تمرینات آسون تر رو ببینی و جواب های مختلفی که دیگران ارسال کرده اند رو بررسی کنی و
یواش یواش به سراغ تمرینات سخت تر بری.
همچنین ممکنه جوابت درست باشه ولی با سایر جواب ها متفاوت باشه
اگه برنامه نویسی رو هنوز شروع نکردی یا خوب یاد نگرفتی، میتونی از طریق لینک زیر یاد بگیری