0
Can anyone explain in simple words what def main is?
like when to use it?
8 Respuestas
+ 2
def main defines a function called main that you can then use in your script.
def main():
print("Hello world!")
main()
+ 2
It is used for reusing code. With that you can take less time to make something multiple times. For example:
def main():
print ("Example")
#And then only you need to put main() instead of print("Example") multiple times
+ 1
def in simply mean is assigning a definition to var e.g
def main():
print ("text")
main ()
this is a simple code that means we define main() to print our text.
0
For the same result
0
thanx animesh
0
can we write something within the parenthesis
0
main is like container of a panel as in html. is it the right simulation
- 1
zen brother how r u