Python Forum
Very Beginner question on simple variables - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Very Beginner question on simple variables (/thread-41940.html)



Very Beginner question on simple variables - Harvy - Apr-11-2024

is this even possible and if so how.

var1 = 123
var2 = 345
var3 = 678
i = 2
print (var.i)

output would be 345


RE: Very Beginner question on simple variables - deanhystad - Apr-12-2024

var = [123, 345, 678]
i = 1
print(var[i])