+ 5

Coad coach balconies problem

https://www.sololearn.com/coach/24?ref=app Has anyone completed this and will show me? Having a tough time visualizing how the two inputs work sorry

1st May 2020, 8:03 PM
Brenner Pieszak
Brenner Pieszak - avatar
6 ответов
+ 4
first = str(input()) second = str(input()) first_list = first.split(',') second_list = second.split(',') a = int(first_list[0]) * int(first_list[1]) b = int(second_list[0]) * int(second_list[1]) if a > b: print ('Apartment A') elif b > a: print ('Apartment B')
10th Jun 2020, 5:35 PM
Jhon Doe
Jhon Doe - avatar
+ 3
in1 = input().split(',') in2 = input().split(',') s1 = int(in1[0]) * int(in1[1]) s2 = int(in2[0]) * int(in2[1]) msg = "Apartment A" if s1 > s2 else "Apartment B" print(msg)
30th Nov 2022, 4:52 PM
Alex1254
+ 2
Hello Brenner Pieszak I am sure you can do it by your own. :) Can you explain your problem? Are you not familiar with user input in general or not with multiple user input? balconyA = input() balconyB = input() Now you need to find a way to extract the width and heights from each string.
1st May 2020, 8:15 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
import math balcony_a = list(map(int, input().split(','))) balcony_b = list(map(int, input().split(','))) square_a = math.prod(balcony_a) square_b = math.prod(balcony_b) if square_a > square_b: print('Apartment A') else: print('Apartment B')
5th Jul 2022, 2:53 AM
wqd dqwwdqwd
wqd dqwwdqwd - avatar
0
def call(): c = [item for item in str(input()).split(',')] return (int(c[0])) * (int(c[1])) a, b = call(), call() if a > b: print ('Apartment A') else: print ('Apartment B')
1st Nov 2022, 12:36 PM
Hamish Zwain
- 1
I tried solving through an array. In C++ code https://code.sololearn.com/c4MgNwu8nUfr/?ref=app
6th Jun 2020, 7:11 PM
Тимофей Орловский