Convert string to variable in python?

Viewed 16682

I am very new with python and programming altogether and have been trying to figure out how to do this for a while.

Here's what I need help with:

y=0
x=2
p01='hello'
p02='bye'

print('p'+(str(y)+str(x)))

The output is of course 'p02', but how can I make the output instead the value of p02 ('bye')

Hope this makes sense and I look forward to any answers.

1 Answers
Related