CodeSolved

A comprehensive source of programming questions and exercises

Calculate the rectangular environment

Practice Easy 247/ Download 2347 Views

Write a program that receives a rectangular length and width and calculates and prints its surroundings

Rectangular environment: width * 2 + length * 2

13 Answers

This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
a = int(input("hight:"))
w = int(input("whidth:"))
print((a + w) * 2)
Mohamad Download Python
def main():
    # Get the length and width of the user
    length = float(input("لطفاً طول مستطیل را وارد کنید: "))
    width = float(input("لطفاً عرض مستطیل را وارد کنید: "))
    
    # Calculate the rectangular environment
    perimeter = 2 * (length + width)
    
    # Printing results
    print(f"محیط مستطیل با طول {length} و عرض {width} برابر است با: {perimeter}")

# Implementation of the program
main()
Mma123 Download Python
A = int(input('طول'))
B = int(input('عرض'))

A = A * 2
B = B * 2
C = A + B

print( C )
Amir.ho Download Python
tole =int(input("enter the tole:"))
arez=int(input("enter the arez:"))
result=tole+arez
result2=result*2
print(result2)
Roghaye.m Download Python
class Math:
	def __init__(self,tole,arze):
		self. tole=tole
		self.arze=arze
	
	def Solve(self):
		return (self.tole+self.arze)*2
	
tole=int(input("enter tole:"))
arze=int(input("enter arze:"))
obj=Math(tole,arze)
print(obj.Solve())
Roghaye.m Download Python
def Mohit(arz, tool):
    return arz *2 + tool*2

arz = int(input("Arz Mostatil :"))
tool = int(input("Tool Mostatil :"))

print(Mohit(arz, tool))
Length = float(input("Length:"))
Width = float(input("Width:"))
print((Length*2)+(Width*2))
Mohammad Download Python
<< Previous page 1 2 Next page >>

Submit answer

Submitting answers is currently unavailable.

Related content

Detection using AI
×
×
Close