Your question is Input Validation Function. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Flow uses workspace slugs in URLs and invitation links. Write a function that determines whether a candidate workspace slug follows Flow's naming rules.
A slug is valid only if it satisfies every requirement below:
-).Return True when the slug is valid and False otherwise. Do not modify the input, such as by trimming whitespace or converting uppercase letters.
Implement validate_flow_slug(slug), where slug is a string. Return a boolean. An empty string is invalid.
def validate_flow_slug(slug):