代碼我寫 tile1=0; player1=1; turn=player1
def s():
global tile1,turn,player1
print("Before",tile1)
string='tile' + '1' # I am getting 1 by some function that's why I need to create variab
在python3,當我運行 >>> exec("","","")
TypeError: exec() arg 2 must be a dict, not str
>>> exec("print('Hello')", print("World"), print("!"))
World
!
Hello
>>> type(print("World"))
World
<class 'Non
我對Python很新穎。我試圖修改一個腳本,使其在無限循環中運行,從控制檯獲取Python代碼行並執行Python代碼行。 我談論的東西,可以做下面的例子: Shell> myconsole.py
> PredefindFunction ("Hello")
This is the result of the PredefinedFunction: Hello!!!
> a=1
> if a