Varibale assignation in python [duplicate]

  python

Suppose I want to enter the multiple values and assign each value to a different variable in order.
Example: if I enter 1 2 3 4 5… and so on as in input then I should get=
p1 = 1, p2 = 2, p3 = 3 and so on…
Variable should be p1,p2,p3 not p[1],p[2],p[3]…
How can I do this in python?

Below is the code:
n = input("Enter the number of values to be entered: ")
for i in range n:
p*i = list(map(str, input("Enter a value: ").split()))

Source: Python Questions

LEAVE A COMMENT