Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pass method

#pass gets you out of the loop and return returns the value for global use

def main():
	x = get_int()
    print(f"x is {x}")
def get_int():
	while True:
		try:
    		return int(input("What's x? "))
		except ValueError:
    		pass
            
main()
 
PREVIOUS NEXT
Tagged: #pass #method
ADD COMMENT
Topic
Name
7+6 =