Reputation: 100
I always type in function something():
. Is their any way to change def
to function
? I know this sounds like a silly question, but I would really appreciate any answers.
If their is something like that, can you also change print
or input
? For example:
name = question("What is your name? ")
answer(f"Hi {name}!")
Upvotes: 4
Views: 352
Reputation: 966
This works for print
and input
:
question = input
answer = print
You can call them like this:
question("What is your name? ")
answer(f"Hi {name}!")
As for changing def
you probably would have to modify the source code of your python installation and recompile it to do something like that. That would be a very bad practice as it would then make it your python installation incompatible with almost 100% of python code that can be downloaded and run.
Take a look at this for more info on changing def
to function
Upvotes: 2