What will be the value of 'result' variable?
Anonymous Quiz
37%
[1, 3, 5, 7, 8]
10%
[1, 7, 8]
14%
[1, 2, 4, 7, 8]
19%
Error
20%
None of the above
Explanation:
Here, 'result' is a list which is extending three times. When first time 'extend' function is called for 'result', the inner code generates a generator object, which is further used in 'extend' function. This generator object contains the values which are in 'list1' only (not in 'list2' and 'list3').
Same is happening in second and third call of 'extend' function in these generator object contains values only in 'list2' and 'list3' respectively. So, 'result' variable will contain elements which are only in one list (not more than 1 list).
🆔 @Python4all_pro
Here, 'result' is a list which is extending three times. When first time 'extend' function is called for 'result', the inner code generates a generator object, which is further used in 'extend' function. This generator object contains the values which are in 'list1' only (not in 'list2' and 'list3').
Same is happening in second and third call of 'extend' function in these generator object contains values only in 'list2' and 'list3' respectively. So, 'result' variable will contain elements which are only in one list (not more than 1 list).
🆔 @Python4all_pro
Ultimate Python Cheatsheet 🔥.pdf
2.3 MB
هر روز یک Cheat Sheet
برگه تقلب شماره 14 پایتون
Cheat Sheet 14 : Ultimate Python cheat sheet
#cheat_sheet #pdf
🆔 @Python4all_pro
برگه تقلب شماره 14 پایتون
Cheat Sheet 14 : Ultimate Python cheat sheet
#cheat_sheet #pdf
🆔 @Python4all_pro
What is the output of the program?
Anonymous Quiz
8%
0-0-5
7%
1-2-10
8%
2-1-5
49%
2-0-5
4%
3-1-10
4%
3-2-6
20%
Error
Pattern 17
#code #pattern
🆔 @Python4all_pro
n = 7
for i in range(7):
if i % 2 == 0:
print("*", end=" ")
else:
print("#", end=" ")
#code #pattern
🆔 @Python4all_pro
What is the output of the code?
Anonymous Quiz
39%
true
9%
false
10%
true false
18%
Error will occur in line 1
12%
Error will occur in line 3
2%
Error will occur in line 4
11%
None of the above
Pattern 18
#code #pattern
🆔 @Python4all_pro
n = 7
for i in range(7):
if i % 3 == 2:
print("@", end=" ")
elif i % 3 == 1:
print("#", end=" ")
else:
print("*", end=" ")
#code #pattern
🆔 @Python4all_pro
کتابخانه های پایتون مجموعه ای از توابع مفید هستند که نیاز به نوشتن کد های اضافی را حذف می کنند و همین ویژگی ها هستند که پایتون را جذاب تر می کند. تعداد کتابخانه های پایتون بسیار بسیار زیاد است؛ بیش از 137000 کتابخانه پایتون وجود دارد. کتابخانه ها نقش حیاتی در توسعه یادگیری ماشین، علم داده، برنامه های کاربردی نظیر پردازش تصویر و داده و موارد دیگر ایفا می کنند.
#کتابخانه
#library
🆔 @Python4all_pro
#کتابخانه
#library
🆔 @Python4all_pro
Forwarded from تهران دیتا-دانشگاه تهران
با تدریس مطرحترین و برجسته ترین اساتید
ارائه گواهینامه دوزبانه با قابلیت ترجمه رسمی و امکان استعلام از دانشگاه تهران
Please open Telegram to view this post
VIEW IN TELEGRAM
Pattern 19
#code #pattern
🆔 @Python4all_pro
n = 7
for i in range(1, n+1):
if i % 2 == 0:
print("$", end=" ")
else:
print(i, end=" ")
#code #pattern
🆔 @Python4all_pro