I'm a month into using Python, fairly new. I had a question regarding functions, and how to implement them. If this kind of question has been asked before, I apologize, and would appreciate it greatly if nudged in the right direction. Here is my code:
def getvalues(num1, num2):
for k in range(0, len(num1)):
if num1[k] > num2:
num1[k] = 0
num1 = int(input('Please enter a integer value, or quit to quit: '))
while num1 not in 'quit':
num1 = int(input('Please enter a integer value, or quit to quit: '))
if num1 in 'quit':
num2 = int(input('Please enter a threshold value: '))
getvalues
What I am trying to do is get the user to input an integer value, and then when the user types 'quit', it will ask for the threshold value, and then display only the integers above the threshold value. I believe the function to be correct, I am having trouble trying to implement the function. I put getvalues at the end to call the function. Should I ask for input after the function? Or is it possible to put it all in the function, then call it, and get user input that way? I want the data to be displayed in a list. I am stuck, and would greatly appreciate any help.
getvaluestogetvalues([argument 1 here], [argument 2 here])intand then comparing to'stop', which won't work. And do you mean "stop" or "quit"?