Q:

Function returns None under message

Hi I'm working on a login app in python, and i wrote this function:
def register_login():
    user_choice = input(print("Would you like to login or register?"))
    user_choice.lower()
    if user_choice == "login":
        print("You will be redirected to the login window.")
    elif user_choice == "register":
        print("You will be redirected to the registration window.")

But whenever i call this function the message gets printed with the value None under it.
Is there a way to get rid of the None message?

A:

I guess you are calling it like this
print(register_login()) because register_login() returns None.
You could return the values and print it like this.
def register_login():
    user_choice = input(print("Would you like to login or register?"))
    user_choice.lower()       
    if user_choice == "login":
        return "You will be redirected to the login window."
    elif user_choice == "register":
        return "You will be redirected to the registration window."

print(register_login())

Alternatively just call it with out the print()
register_login()

Side note - this line does nothing.
user_choice.lower()

you would want to replace it with.
user_choice = user_choice.lower()

or
user_choice = input("Would you like to login or register?").lower()

