0
Whats wrong with this please help
from itertools import accumulate, takewhile def ui(): x = 0 while x <= 6: return True nums = list(accumulate(range(8))) print(nums) print(list(takewhile(ui(), nums))) Lesson says while a function returns true Please explain and correct me😁
1 ответ
+ 1
Abdul Manan Jutt x is input for ui
from itertools import accumulate, takewhile
def ui(x): # x will be parameter to ui
# x = 0
while x <= 6:
return True
nums = list(accumulate(range(8)))
print(nums)
print(list(takewhile(ui, nums))) # function name without ()