r/programminghelp • • May 03 '20

Answered I need some help with python lol

i have 2 questions i am still trying to figure out the whole python thing but my first question is that I need to write a line of Python code to iterate over and print the values in a list called my_list on a separate line. How would i go about doing that?

and my second question is that I trying to make a python function that takes an string argument.  This function must ask the user for a input until it gets a number from 50 to 100 and when it does, return that number to the caller of the function. How would i go about doing that?

3 Upvotes

1 comment sorted by

2

u/Hippiedhumppied May 03 '20

For you first question,did you try using a “for” loop to iterate over your list? For the second question, you can use a “if” statement (ex. If [your variable] >= 50: (resulting action) Sorry for the quality of my answer. Hope it helps