I have a basic Python encryption program. The program is pretty much done, but I keep getting errors because of the way Python is building my variable.
Here is an example of what I am trying to do:
A = 4
B = 2
C = 3
for i in range (3):
A=A, ((B*2) + C)
A = (((4, 7), 7), 7)
I want A to output 4, 7, 7, 7 and as it loops, it adds numbers onto the end instead of adding them together. The issue here is that for whatever reason, I can't target specific values, for example, if I did
print (A[2])
The output would be an error
Traceback (most recent call last):
File "C:/Users/name/Desktop/Python/Test.py", line 8, in <module>
print (A[2])
IndexError: tuple index out of range
Ignoring the above code, what is the best way I could do this? Thanks!
Ato be alistand append to it in each loop?