def foo(n):
if n == 0:
return 0
return n - foo(n-1)
print(foo(3))
A) 0
B) 1
C) 2
D) 3
#پایتون #برنامه_نویسی
📋 @PRG4All
@PRG4All · 493 subscribers
The short link opens the channel straight in the Telegram app — not in a browser tab.
tg.me/go/PRG4AllIs this your channel? Add @tgme as admin — and see how many people click your links. Get the stats →
Channel created April 19, 2024per Telegram
We have been tracking it since July 17, 2026
In all that time the channel has changed neither its name, nor its @username, nor its avatar.
We show only what we have seen ourselves.
[media, no text]
def foo(n):
if n == 0:
return 0
return n - foo(n-1)
print(foo(3))
[media, no text]
class MyClass:
__slots__ = ['x', 'y']
obj = MyClass()
obj.x = 10
obj.z = 20
z با مقدار ۲۰ به شیء اضافه میشود. AttributeError رخ میدهد. z به ۲۰ تنظیم میشود، اما x تغییر نمیکند. z نادیده گرفته میشود.