Skip to main content

list_int_input

Prompts the user for input and converts the resulting string into a list of integers.

def list_int_input(
prompt: string
) - > list[int]

Prompts the user to enter a comma-separated list of integers via standard input and parses them into a list of integers. This function is used to collect multiple numeric identifiers or values from a command-line interface while handling basic whitespace formatting.

Parameters

NameTypeDescription
promptstringThe text message displayed to the user to indicate what values should be entered.

Returns

TypeDescription
list[int]A list of integers parsed from the user's input string.