I know this may be a silly question..., but I'm trying to create a function in python that allows me to register an account for the admin user.

And in fact, the approach that I took works as I expected, but even so, it seems to me a bit..., I'm trying to familiarize myself a bit with python and stuff. I feel like I'm not using everything that could be done in python, to be more precise I feel like I'm stuck in a narrow scope. And while I know there is such a thing as setting default parameters, I'm a bit 'skeptical' about its uses, as I'm not very familiar with it, I really don't know if that would be an advantage or disadvantage, especially when it would be a large application.

That's why I was wondering if there was a... clever way? to achieve what I seek to do.

Here's the code:

"""
application entry point.
"""

import getpass
import datetime

from example import app, db, User

"""
"""
firstname = str(input('enter your name: '))
email = str(input('enter your email: '))

if firstname == "":
if email == "":

else:
try:
first_name=firstname,
email=email,
is_confirmed=True,
confirmed_on=datetime.datetime.now()
)
)
db.session.commit()
print(f'admin with email {email} was created successfully!')
except Exception: