The Divmod (b) function is a tuple that implements a divided by B, then returns the quotient and remainder, eval can execute a string form of an expression, and the EXEC statement is used to execute a python statement stored in a string or file

Source: Internet
Author: User

Tag: Color nbsp Contains the pre file bin character to perform Hello

1 #!/usr/bin/env python2A = 10/33 Print(a)4 #divmod Computing quotient and remainder5R = Divmod (10001,20)6 Print(R)7 #eval can execute a string-form expression8ret = eval ("1 + 3")9c = eval ("A +",{"a": 99})Ten Print(ret) One Print(c) A """The EXEC statement is used to execute a python statement stored in a string or file.  - For example, we can generate a string that contains Python code at run time, and then execute the statements using the EXEC statement.  - The following is a simple example.  the >>> exec ' print ' Hello world ' - Hello World - Note that the use of the EXEC statement in the example is not the same as Eval_r (), execfile (). - exec is a statement (like print or while), whereas Eval_r () and execfile () are built-in functions. + """ - exec("For i in range: print (i)")

The Divmod (b) function is a tuple that implements a divided by B, then returns the quotient and remainder, eval can execute a string form of an expression, and the EXEC statement is used to execute a python statement stored in a string or file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.