列表解析
各位大佬,想问一下下面这个for循环可以用列表解析写吗?from random import randint
def roll():
return randint(1,6)
results = []
for roll_num in range(100):
result = roll()
results.append(result)
print(results)
from random import randint
def roll():
return randint(1,6)
results =
print(results)
页:
[1]