I wanted to make a program that adds the data from a while loop to a list, and computes the data. However, when I use .append, It returns nothing.
structure = input("Equation: ")
print("RANGE")
upper_lim = int(input("Upper limit: "))
value_i = int(input("The value of 'i': "))
nth = [""]
substitution = [""]
while value_i <= upper_lim and "i" in structure and "+" not in structure:
substitution = print(structure.replace("i", "(" + str(value_i) + ")"))
value_i += 1
nth.append(substitution)
while value_i <= upper_lim and "i" in structure:
substitution = print(structure.replace("i", "(" + str(value_i) + ")"))
value_i += 1
nth.append(substitution)
print(nth)
It came out as:
['', None, None, None]
instead of something like:
[numbers,numbers,numbersr]