+ 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
6 Answers
+ 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')
+ 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)
+ 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.
+ 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')
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')
- 1
I tried solving through an array. In C++ code
https://code.sololearn.com/c4MgNwu8nUfr/?ref=app