+ 1
How to fill list from input user?Like this.If i input 3 the result is [1,2,3] and when i input 2 for 2nd result is [2,4,3]
python bab tuple and list
2 Answers
+ 1
it's just one list.My expectation is when the input fill with 3,if the second input are 5.Output is input 1 + 2 and if len(5)-len(3) are 2.The result will be this 2,4,6,4,5.I want to ask how to make the next input can recognized for variabel change second input and operation will be continue
0
I can't find a logic for the 2nd input.
The first one is easy:
input_num = int(input("Number: "))
print(list(range(1, input_num+1)))