PYTHON_TASKS Telegram 2757
Даны два модуля testmod.py и runmod.py
#testmod.py
x = 0
def f1():
x = 10
def f2():
global x
x += 1
def f3():
import testmod
testmod.x += 1
def f4():
import sys
sys.modules["testmod"].x += 1

#runmod.py
import testmod as t
t.f1();t.f2();t.f3();t.f4()
print(t.x)



tgoop.com/python_tasks/2757
Create:
Last Update:

Даны два модуля testmod.py и runmod.py

#testmod.py
x = 0
def f1():
x = 10
def f2():
global x
x += 1
def f3():
import testmod
testmod.x += 1
def f4():
import sys
sys.modules["testmod"].x += 1

#runmod.py
import testmod as t
t.f1();t.f2();t.f3();t.f4()
print(t.x)

BY Python Tasks & ML | Задачи по питону и машинному обучению


Share with your friend now:
tgoop.com/python_tasks/2757

View MORE
Open in Telegram


Telegram News

Date: |

Write your hashtags in the language of your target audience. Telegram Android app: Open the chats list, click the menu icon and select “New Channel.” So far, more than a dozen different members have contributed to the group, posting voice notes of themselves screaming, yelling, groaning, and wailing in various pitches and rhythms. “[The defendant] could not shift his criminal liability,” Hui said. Step-by-step tutorial on desktop:
from us


Telegram Python Tasks & ML | Задачи по питону и машинному обучению
FROM American