|
|
вернуться в форумPython Wrong answer test#1 I'm just learning python. Can you please tell me where could be the error? import math data = input() length = len(data) list = [] i = 0 while i < length: if data[i] != " " and data[i] != "\n": end_index = i for j in range(i + 1, length): if data[j] == " " or data[i] == "\n": break end_index += 1 list.insert(0, int(data[i:end_index + 1])) i = end_index + 1 else: i += 1 for e in list: value = round(math.sqrt(e), 4) print(f'{value:.4f}') Re: Python Wrong answer test#1 Послано yyll 17 июн 2022 14:38 You only need to write about 3 lines of python code to solve this. try: help(str.split) help(reversed) help(str.join) |
|
|