Feb-05-2019, 02:54 PM
I am trying to write pseudocode; however, I don't understand how calling variables work in Python. My goal is to ask a user to enter a string, which I would like to store as a variable. The caveat is the user's entry is the variable that I would like to store as. Is there a way to use that user's entry and somehow call it later? I think I kind of just answered my own question, but I am curious to know what is possible.
Second part to this problem is if I am creating an iteration, such as a 'for' loop, which repeats x number of times as determined by a user's input (input x times to repeat loop), how can a variable be assigned if there are x number of loop iterations? Is there a way to program Python to assign a number to the variable based on the number of iterations, and then use that code to define the variable? I think I just answered my own question again. However, I am not sure. Thanks in advance for any help with this.
Second part to this problem is if I am creating an iteration, such as a 'for' loop, which repeats x number of times as determined by a user's input (input x times to repeat loop), how can a variable be assigned if there are x number of loop iterations? Is there a way to program Python to assign a number to the variable based on the number of iterations, and then use that code to define the variable? I think I just answered my own question again. However, I am not sure. Thanks in advance for any help with this.