PyVision | پای‌ویژن
68 subscribers
63 photos
41 files
113 links
آموزش زبان برنامه‌نویسی Python 🐍
از مفاهیم پایه تا مباحث پیشرفته و کاربردی
ورود به دنیای هوش مصنوعی💻
یاد بگیریم،
تمرین کنیم،
حرفه‌ای شویم.

Step by Step Python Programming Tutorial
From Basics to Advanced Projects & AI

ارتباط با ادمین:
🌐 @Its_poryaa
Download Telegram
PyVision | پای‌ویژن
پاسخ صحیح؟!🔥 👇🏽 Correct answer?! #️⃣ #پایتون #کدنویسی #چالش_پایتون #برنامه‌نویسی #آموزش_پایتون #منطق_پایتون #پای_ویژن #Python #PythonChallenge #Coding #LearnPython #Programming #LogicOperators #PythonTips #PyVision 🌐 @PyVision
پاسخ:

True  
True
False

📘 در پایتون می‌توانیم مقایسه‌های زنجیره‌ای انجام بدهیم؛
عبارت 1 < x < 10 یعنی:

(1 < x) and (x < 10)

اما در خط آخر، شرط x > 10 برقرار نیست،
پس نتیجه‌ی نهایی False خواهد شد.

Python allows chained comparisons.
1 < x < 10 is the same as (1 < x and x < 10).
Since x > 10 is False, the last line prints False.


#️⃣ #پایتون #کدنویسی #چالش_پایتون #برنامه‌نویسی #آموزش_پایتون #منطق_پایتون #پای_ویژن
#Python #PythonChallenge #Coding #LearnPython #Programming #LogicOperators #PythonTips #PyVision


🌐 @PyVision
🔥2🤩1
پاسخ صحیح؟!🔥 👇🏽
Correct answer?!

x = 0
y = 1

if x or y and not x:
print("A")
elif not y or x and y:
print("B")
else:
print("C")

#️⃣ #پایتون #کدنویسی #چالش_پایتون #برنامه‌نویسی #آموزش_پایتون #منطق_پایتون #پای_ویژن
#Python #PythonChallenge #Coding #LearnPython #Programming #LogicOperators #PythonTips #PyVision

🌐 @PyVision
🔥2🤔1
خروجی چیست؟ 🤔
What's output?

result = 0

for i in range(3):
for j in range(i):
result += j

print(result)

📌 نکته: مقدارهای i و j را مرحله‌به‌مرحله دنبال کنید؛
اما مراقب باشید! بعضی از دورهای حلقه اصلاً اجرا نمی‌شوند.

#️⃣ #پایتون #کدنویسی #چالش_پایتون #برنامه‌نویسی #آموزش_پایتون #منطق_پایتون #پای_ویژن
#Python #PythonChallenge #Coding #LearnPython #Programming #LogicOperators #PythonTips #PyVision

🌐 @PyVision
👍2
✳️ خروجی چیست؟🤔👇🏽
✳️ What's the output?


x = 5
y = 0

for i in range(3):
if (x % 2 == 1) and not (i == 1):
y += i
else:
y -= 1

while x > 2 and y < 4:
if x % y != 0 or y == 0:
x -= 1
y += 2
else:
x -= 2

print(x, y)

#️⃣ #پایتون #کدنویسی #چالش_پایتون #برنامه‌نویسی #آموزش_پایتون #منطق_پایتون #پای_ویژن
#Python #PythonChallenge #Coding #LearnPython #Programming #LogicOperators #PythonTips #PyVision

🌐 @PyVision
👌3
با توجه به کد زیر، خروجی نهایی دو دستور print چیست؟
و کدام یک از دو آبجکت a و b شناسهٔ (id) جدید می‌گیرد؟

❓️Given the code below, what is the final output of the two print?
And which one of the two objects, a or b, receives a new id?

a = (1, 2, 3)
b = [1, 2, 3]

a += (4, 5)
b += [4, 5]

print(a)
print(b)

🔍 نکتهٔ

● تاپل‌ (tuple) غیرقابل‌تغییر است و += یک آبجکت جدید می‌سازد.
● لیست (list) قابل‌تغییر است و += روی همان آبجکت قبلی اعمال می‌شود.



#️⃣ #برنامه_نویسی #آموزش_پایتون #پای_ویژن
#Python #PythonChallenge #PythonTypes #CodingChallenge #PyVision

🌐 @PyVision
🔥3