I'm looking to use a for loop to create multiple variables, named on the iteration (i), and assign each one a unique int.
Xpoly = int(input("How many terms are in the equation?"))
terms={}
for i in range(0, Xpoly):
terms["Term{0}".format(i)]="PH"
VarsN = int(len(terms))
for i in range(VarsN):
v = str(i)
Temp = "T" + v
Var = int(input("Enter the coefficient for variable"))
Temp = int(Var)
As you see at the end I got lost. Ideally I'm looking for an output where
T0 = #
T1 = #
T... = #
T(Xpoly) = #
Any Suggestions?
You can do everything in one loop
And later you can use
But it is probably better to a use list rather than a dictionary
And later you can use
or even (to get first three terms)