Mar-26-2023, 05:03 PM
Hello team,
I have the following function
I am getting the following error:
Thanks in advance.
I have the following function
import string import random def check_input(*args): length = args[0] while length <= 0: length = int(input("[!] Please insert a positive integer: ")) number = args[1] while length < number: number = int(input("[!] Please insert a positive integer: ")) check_input(-1) check_input(5)I would like to compare the first argument, in the above example it would ask to input another value instead of -1, and the second argument, in the above example 5.
I am getting the following error:
Error:IndexError: tuple index out of range
I see *args prints the following when I print(args)
(-1,) (5,)Could you please help me with how can I access the second and the following tuples to come for that function?
Thanks in advance.