+ 1
How to create Python keywords for personal needs?
Hello! I want to have my own keywords like average, sum, .... I don't want to import module or write function.
5 odpowiedzi
+ 14
You can using this 😊😊
sum(1,2)
this is your keywords (function name)
Python have enough keywords for using 😼😼
+ 4
Without <<import module or write function >> you cannot define/create new << keywords >> (right word is "identifier" ^^)
+ 4
@Martin: I haven't consider this option, as this would require more stuff than just write functions ;)
+ 1
if you really don't want to implement functions or import modules, you would have to extend and compile your own version of python - but I see absolutely no reason for doing that.
+ 1
@visph under normal circumstances I wouldn't have considered this neither - but his restrictions somehow don't leave room for other options :-)