+ 1

Who can explain this question

We need to calculate the area of the rectangle. Complete and call the function to output the area of the rectangle, taking 2 arguments as length and width. If sides are equal, the function should also show "Square" as the second output. Sample Input 1 7 4 Sample Output 1 28 How can I assign output # 2 in the code to complete the task? https://code.sololearn.com/cY6UoI9ZuocK/?ref=app

6th Jan 2021, 7:57 PM
XLK
XLK - avatar
11 Answers
+ 9
length = int(input()) width = int(input()) def area(length, width): #your code goes here print (length * width ) if length == width: print ("Square") area(length,width)
6th Jan 2021, 8:28 PM
Martin Ed
Martin Ed - avatar
+ 3
length = int(input()) width = int(input()) def area(length, width): print (length*width) area(length,width)
31st Jan 2022, 3:51 PM
Akshay Kumar Mishra
+ 2
w = int(input()) h = int(input()) #call the function def area(h, w): #your code goes here print (h * w ) if h == w: print ("Square") area(h,w)
2nd Feb 2022, 7:02 PM
bouhajja belhassen
+ 1
Thanks for help
6th Jan 2021, 8:30 PM
XLK
XLK - avatar
+ 1
length = int(input()) width = int(input()) def area(length, width): area(length, width) area = length*width print(area) if length==width: print("Square")
30th Dec 2021, 7:00 PM
Shahad Al-Shama
+ 1
length = int(input()) width = int(input()) def area(length, width): #your code goes here print (length * width ) if length == width: print ("Square") area(length,width)
10th Feb 2022, 3:09 PM
Ayush
Ayush - avatar
+ 1
length = int(input()) width = int(input()) def area(length, width): #your code goes here print (length * width ) if length == width: print ("Square") area(length,width) done...!
6th Mar 2022, 2:51 PM
Nikhila
+ 1
length = int(input()) width = int(input()) def area(length, width): #your code goes here print (length * width ) if length == width: print ("Square") area(length,width)
31st Mar 2022, 9:54 PM
Abdelkhalek Nael Ahmad Allan
Abdelkhalek Nael Ahmad Allan - avatar
+ 1
length = int(input()) width = int(input()) def area(length, width): print(length*width) if length == width: print ("Square") else: area(length,width)
19th Jul 2022, 10:11 AM
Fatemeh
Fatemeh - avatar
0
#include <iostream> using namespace std; int main() { //sides of the room double length = 5.4; double width = 2.3; cin >> length; cin >> width; //output the area cout << length*width; return 0; } that's it buddies., hahhahaha !!!! just try its correct
10th May 2022, 12:46 PM
Giri Prasath K
0
w = int(input()) h = int(input()) def area(w, h): print (w * h ) area(w,h)
3rd Jun 2022, 4:18 PM
Evgen Shamanayev
Evgen Shamanayev - avatar