How to use 'input().split()' in Python

Every line of 'input().split()' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
126def split_string(input_string):
127 '''Split a string to a list and strip it
128 :param input_string: A string that contains semicolons as separators.
129 '''
130 string_splitted = input_string.split(';')
131 # Remove whitespace at the beginning and end of each string
132 strings_striped = [string.strip() for string in string_splitted]
133 return strings_striped
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code


Related snippets