Thank you for your patience... and encouragement ! I appreciate the opportunity to ask questions and learn on this forum.
Here's what I managed so far. While I'm able to generate correct integers, I'm still having some difficulty in creating a flat list without quotes when removing the trailing zeros (see below). Let me know if there's a more elegant way to achieve what I'm looking for. THANK YOU!
Here's what I managed so far. While I'm able to generate correct integers, I'm still having some difficulty in creating a flat list without quotes when removing the trailing zeros (see below). Let me know if there's a more elegant way to achieve what I'm looking for. THANK YOU!
def streched(list): list_strech = [x * 1.4 for x in list] list_round = [round(x * 2) / 2 for x in list_strech] list_cleaned = [str(s).rstrip('0').rstrip('.') for s in list_round] print(list) print(list_strech) print(list_round) print(list_cleaned) list = [0, 6, 11, 16] streched(list)