Before we jump more into Python coding, we get familiarize with Python Main function and its importance. Consider the following code def main() print "hello world!" print "Guru99" Here we got two pieces of print one is defined within a main function that is "Hello World" and the other is independent which is "Guru99". When you run the function def main (): Only "Guru99" prints out and not the code "Hello World." It is because we did not declare the call function "if__name__== "__main__". When Python interpreter reads a source file, it will execute all the code found in it. When Python runs the "source file" as the main program, it sets the special variable (__name__) to have a value ("__main__"). When you execute the main function, it will then read the "if" statement and checks whether __name__ does equal to __main__. In Python "if__name__== "__...
Very good blog! For sharing content and such nice information for me. I hope you will share some more content about. Please keep sharing! Php Web Development Services
ReplyDeleteThanks for posting this, Keep Sharing good content.
ReplyDeleteData Science Online Training
Python Online Training
Salesforce Online Training
ReplyDeleteQuick up your career with Azure Training in Chennai from Infycle Technologies, the best software training institute in Chennai. A massive place to learn topmost technical courses like Medical Coding, Mobile App Development, Data Science, Big Data, BlockChain, Full Stack Development, Digital Marketing with Graphic Design, Python, and Oracle with emphasized trainers of the industry. Speak to us on 7504633633, 7502633633 to know the updated offers for your learning.