pep570

How to implement "positional-only parameter" in a user defined function in python?

How to implement "positional-only parameter" in a user defined function in python? Question: How can I implement “positional-only parameter” for a function that is user defined in python? def fun(a, b, /): print(a**b) fun(5,2) # 25 fun(a=5, b=2) # should show error Asked By: Damodara Sahu || Source Answers: Update: this answer will become increasingly …

Total answers: 3