我的代码中有以下函数(也在所示的类中):
class Range:
def __init__(self, string_representation: str):
self.string_representation = string_representation
# ...
def get_start_and_end_numbers(self): # <--- This one
return map(int, self.string_representation.split('-'))
# ...
如您所见,它的作用是:给定一个 string_representation
像 '1-4'
,该函数返回一个 map()
对象,该对象产生整数值 1
和 {{ 1}}。
所以我猜这应该足够了:
4
但是我不会输入提示地图的“内容”,即:整数。
那么,我应该如何输入返回 def get_start_and_end_numbers(self) -> map:
return map(int, self.string_representation.split('-'))
对象的提示?