Answer: Here you go, alter these however you'd like
Step-by-step explanation:
Pseudocode:
func RangeCheck(username: string, min: int, max: int): bool {
if username.len >= min && username.len <= max then
return true
return false
}
func main() {
usr = input("> Enter username: ")
if RangeCheck(usr, 5, 10) then println("Username valid.")
else println("Username invalid")
}
Python:
def rangeCheck(username, min, max) -> bool:
if len(username) >= min and len(username) <= max:
return True
return False
def __main__():
usr = input("> Enter username: ")
if rangeCheck(usr, 5, 10): print("Username valid")
else: print("Username invalid")
if __name__ == "__main__":
__main__()