Closed lewisjwilson closed 3 years ago
Implement the following recursive function and define key presses to scroll through the data
from itertools import islice # recursive funtion to display slices of a list def entries(start, stop): for item in islice(mylist, start, stop): print(item) raw = input("Press Enter...") if(raw == ""): start += 1 stop += 1 entries(start, stop) elif(start>0): start -= 1 stop -= 1 entries(start, stop) mylist = ["感じ", "漢字", "先生", "食べる", "空気", "チーズ", "飲む"] start = 0 stop = 1 entries(start, stop)
Implement the following recursive function and define key presses to scroll through the data