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