پاسخ صحیح؟!🔥 👇🏽
Correct answer?!
#️⃣ #پایتون #کدنویسی #چالش_پایتون #برنامهنویسی #آموزش_پایتون #منطق_پایتون #پای_ویژن
#Python #PythonChallenge #Coding #LearnPython #Programming #LogicOperators #PythonTips #PyVision
🌐 @PyVision
Correct answer?!
#️⃣ #پایتون #کدنویسی #چالش_پایتون #برنامهنویسی #آموزش_پایتون #منطق_پایتون #پای_ویژن
#Python #PythonChallenge #Coding #LearnPython #Programming #LogicOperators #PythonTips #PyVision
🌐 @PyVision
🔥1🤩1
PyVision | پایویژن
پاسخ صحیح؟!🔥 👇🏽 Correct answer?! #️⃣ #پایتون #کدنویسی #چالش_پایتون #برنامهنویسی #آموزش_پایتون #منطق_پایتون #پای_ویژن #Python #PythonChallenge #Coding #LearnPython #Programming #LogicOperators #PythonTips #PyVision 🌐 @PyVision
✅ پاسخ:
📘 در پایتون میتوانیم مقایسههای زنجیرهای انجام بدهیم؛
عبارت 1 < 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
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?!
#️⃣ #پایتون #کدنویسی #چالش_پایتون #برنامهنویسی #آموزش_پایتون #منطق_پایتون #پای_ویژن
#Python #PythonChallenge #Coding #LearnPython #Programming #LogicOperators #PythonTips #PyVision
🌐 @PyVision
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?
📌 نکته: مقدارهای i و j را مرحلهبهمرحله دنبال کنید؛
اما مراقب باشید! بعضی از دورهای حلقه اصلاً اجرا نمیشوند.
#️⃣ #پایتون #کدنویسی #چالش_پایتون #برنامهنویسی #آموزش_پایتون #منطق_پایتون #پای_ویژن
#Python #PythonChallenge #Coding #LearnPython #Programming #LogicOperators #PythonTips #PyVision
🌐 @PyVision
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 output?
#️⃣ #پایتون #کدنویسی #چالش_پایتون #برنامهنویسی #آموزش_پایتون #منطق_پایتون #پای_ویژن
#Python #PythonChallenge #Coding #LearnPython #Programming #LogicOperators #PythonTips #PyVision
🌐 @PyVision
What's output?
x = 3
y = 0
while x > 0:
y += x % 2
x -= 1
print(y)
#️⃣ #پایتون #کدنویسی #چالش_پایتون #برنامهنویسی #آموزش_پایتون #منطق_پایتون #پای_ویژن
#Python #PythonChallenge #Coding #LearnPython #Programming #LogicOperators #PythonTips #PyVision
🌐 @PyVision
🔥3
✳️ خروجی چیست؟🤔👇🏽
✳️ What's the output?
#️⃣ #پایتون #کدنویسی #چالش_پایتون #برنامهنویسی #آموزش_پایتون #منطق_پایتون #پای_ویژن
#Python #PythonChallenge #Coding #LearnPython #Programming #LogicOperators #PythonTips #PyVision
🌐 @PyVision
✳️ 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
✳️ خروجی چیست؟🤔
✳️ What's the output?
#️⃣ #پایتون #کدنویسی #چالش_پایتون #برنامهنویسی #آموزش_پایتون #منطق_پایتون #پای_ویژن
#Python #PythonChallenge #Coding #LearnPython #Programming #LogicOperators #PythonTips #PyVision
🌐 @PyVision
✳️ What's the output?
a = 0
b = 5
if a or b:
print("Yes")
else:
print("No")
#️⃣ #پایتون #کدنویسی #چالش_پایتون #برنامهنویسی #آموزش_پایتون #منطق_پایتون #پای_ویژن
#Python #PythonChallenge #Coding #LearnPython #Programming #LogicOperators #PythonTips #PyVision
🌐 @PyVision
🤩3