Thursday, October 12, 2017

Python First Sample Code

Sample Code Python

Sample 1:
def main():
  print "Hello Folks!" 

print "Welcome to Python Programming"

Sample 1 - Output:
Welcome to Python Programming

Reason:
It is Important that after defining the main function, you call the code by
if__name__=="__main__"
and then run the code, only then you will get the output "hello Folks" in console

Sample 2:

def main():
  print "Hello Folks!"


if __name__== "__main__":
  main()


print "Welcome to Python Programming"

Sample 2 - Output:
Hello Folks!
Welcome to Python Programming

No comments:

Post a Comment

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...