Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+3 votes

This is again for the quiz... How do I turn an input number into an integer so I can have the text repeat however many times the number is?

asked in CSC201 Spring 2021 by (1 point)

2 Answers

+5 votes
 
Best answer

Use this form:
variable = int(input('Words to prompt the user for a value'))
Ex: number = int(input('How many times to repeat?'))

Also, I remember Prof did explain this issue in the lecture presentation ( Check it if needed on pg.17):
https://moodle.augustana.edu/pluginfile.php/227259/mod_resource/content/0/Day01-introduction.pdf

Hope this helps!

answered by (1 point)
selected by
+2 votes

I did for I in range (int(whatever the previous input is))

answered by (1 point)
...