def return_negative_one(): return -1 print(return_negative_one())
If you want to convert boolean into int then use the below code to get Python to return 1
def one(): myBoolean = True return int(myBoolean) print(one())
Do comment if you have any doubts and suggestions on this Python return topic.
Note: IDE: PyCharm 2021.3 (Community Edition)
All Python Examples are in Python 3, so Maybe its different from python 2 or upgraded versions.
Degree in Computer Science and Engineer: App Developer and has multiple Programming languages experience. Enthusiasm for technology & like learning technical.