I began python not a long time ago, and i am doing a program that sometimes needs to make a lot of repetitions in function of different entries. it takes a lot of place, I think it makes the program work slower, and most of all, im limited if I want to in high numbers. here is an example of these type of repetitions:
if len(input) == 1:
text1, textx = text.split('\n')
elif len(input) == 2:
text1, text2, textx = text.split('\n')
elif len(input) == 3:
text1, text2, text3, textx = text.split('\n')
elif len(input) == 4:
text1, text2, text3, text4, textx = text.split('\n')
elif len(input) == 5:
text1, text2, text3, text4, text5, textx = text.split('\n')
elif len(input) == 6:
text1, text2, text3, text4, text5, text6, textx = text.split('\n')
elif len(input) == 7:
text1, text2, text3, text4, text5, text6, text7, textx = text.split('\n')
elif len(input) == 8:
text1, text2, text3, text4, text5, text6, text7, text8, textx = text.split('\n')
if someone could give me a solution to avoid that, it would be really nice and helpful. thanks, have a great day :)