✅ Correct Answer: B) 3
📘 Explanation:
// is the floor division operator in Python.
It divides two numbers and returns the largest integer less than or equal to the result.
10 // 3 equals 3.333..., and the floor of that is 3 (as an integer).
React ❤️ if you got it right
📘 Explanation:
// is the floor division operator in Python.
It divides two numbers and returns the largest integer less than or equal to the result.
10 // 3 equals 3.333..., and the floor of that is 3 (as an integer).
React ❤️ if you got it right
Forwarded from TECH BY WEB CODER
Python Programming Notes.pdf
6.7 MB
Important Web Developer Language Notes 🔗
👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻
Topic :- Python (Basic To Advance)
👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻
Topic :- Python (Basic To Advance)
❤1
🧠 Python MCQ Question
❓ What is the output of the following code? >>print(type([]) == list)
❓ What is the output of the following code? >>print(type([]) == list)
Anonymous Poll
51%
True
14%
False
28%
<class 'list'>
7%
Error
✅ Correct Answer: A) True
📘 Explanation:
[] creates an empty list.
type([]) returns <class 'list'>.
So, type([]) == list compares <class 'list'> == list, which is True.
React ❤️ if you got it right
📘 Explanation:
[] creates an empty list.
type([]) returns <class 'list'>.
So, type([]) == list compares <class 'list'> == list, which is True.
React ❤️ if you got it right
🧠 Python MCQ Question
❓ What is the output of the following code? >>print([i**2 for i in range(3)])
❓ What is the output of the following code? >>print([i**2 for i in range(3)])
Anonymous Poll
18%
[1, 2, 3]
32%
[0, 1, 4]
27%
[1, 4, 9]
23%
[0, 1, 2]
✅ Correct Answer: B) [0,1,4]
📘 Explanation:
This is a list comprehension that squares each number in range(3) → [0, 1, 2]. So:
0**2 = 0
1**2 = 1
2**2 = 4
Hence, the output is [0, 1, 4].
React ❤️ if you got it right
📘 Explanation:
This is a list comprehension that squares each number in range(3) → [0, 1, 2]. So:
0**2 = 0
1**2 = 1
2**2 = 4
Hence, the output is [0, 1, 4].
React ❤️ if you got it right
❤1
🧠Python MCQ Question
❓What is the output of the following code? >>print([i for i in range(5) if i % 2])
❓What is the output of the following code? >>print([i for i in range(5) if i % 2])
Anonymous Poll
28%
[0, 1, 2, 3, 4]
30%
[1, 3]
29%
[0, 2, 4]
13%
[2, 4]
✅Correct Answer: B) [1, 3]
📘Explanation:
range(5) generates numbers: [0, 1, 2, 3, 4].
i % 2 checks if the number is odd (i.e., remainder when divided by 2 is 1).
Only 1 and 3 satisfy this condition.
So the list comprehension filters out odd numbers: [1, 3].
React ❤️ if you got it right
📘Explanation:
range(5) generates numbers: [0, 1, 2, 3, 4].
i % 2 checks if the number is odd (i.e., remainder when divided by 2 is 1).
Only 1 and 3 satisfy this condition.
So the list comprehension filters out odd numbers: [1, 3].
React ❤️ if you got it right
❤1
Forwarded from TECH BY WEB CODER
Python Project.pdf
620.1 KB
Important Web Developer And Programming Language Related Project🔗
👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻
Topic :- Python (Basic To Advance Project)
👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻
Topic :- Python (Basic To Advance Project)
🧠 Python MCQ Question
❓What will be the output of the following Java code? >>print((lambda x: x**2)(3))
❓What will be the output of the following Java code? >>print((lambda x: x**2)(3))
Anonymous Poll
28%
6
48%
9
9%
3
15%
None
Correct Answer: B) 9
📘Explanation:
This is an example of an anonymous function using lambda.
(lambda x: x**2) defines a function that returns the square of x.
(3) calls this function with argument 3, so 3**2 = 9
React ❤️ if you got it right
📘Explanation:
This is an example of an anonymous function using lambda.
(lambda x: x**2) defines a function that returns the square of x.
(3) calls this function with argument 3, so 3**2 = 9
React ❤️ if you got it right
❤2
Forwarded from TECH BY WEB CODER
Python Function.pdf
416.4 KB
Important Web Developer And Programming Language Related Notes🔗
👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻
Topic :- Python (Basic To Advance All Functions)
👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻
Topic :- Python (Basic To Advance All Functions)
🧠 Python MCQ Question
❓What will be the output of the following Java code? >>print("python"[::-1])
❓What will be the output of the following Java code? >>print("python"[::-1])
Anonymous Poll
34%
Python
26%
nohtyp
23%
nothyP
17%
Error
❤1
✅Correct Answer:B) nohtyp
📘Explanation:
The slicing syntax [::-1] means reverse the string.
"python" reversed is "nohtyp".i
React ❤️ if you got it right
📘Explanation:
The slicing syntax [::-1] means reverse the string.
"python" reversed is "nohtyp".i
React ❤️ if you got it right
Forwarded from TECH BY WEB CODER
python Question.pdf
1 MB
Important Web Developer And Programming Language Related Notes🔗
👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻
Topic :- Python (Basic To Advance Interview Question)
👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻👇🏻
Topic :- Python (Basic To Advance Interview Question)
🧠 Python MCQ Question
❓What will be the output of the following? >>print(sum([i for i in range(4)]))
❓What will be the output of the following? >>print(sum([i for i in range(4)]))
Anonymous Poll
42%
6
32%
10
13%
3
14%
4
✅Correct Answer: A) 6
📘Explanation:
range(4) generates [0, 1, 2, 3].
The list comprehension [i for i in range(4)] creates a list of those values.
sum([0, 1, 2, 3]) = 6.
React ❤️ if you got it right
📘Explanation:
range(4) generates [0, 1, 2, 3].
The list comprehension [i for i in range(4)] creates a list of those values.
sum([0, 1, 2, 3]) = 6.
React ❤️ if you got it right
🧠 Python MCQ Question
❓What will be the output of the following? >>print(bool([]))
❓What will be the output of the following? >>print(bool([]))
Anonymous Poll
23%
True
40%
False
16%
[ ]
21%
None
✅Correct Answer: B) False
📘Explanation:
An empty list [] is considered falsy in Python.
bool([]) converts the list to its Boolean value, which is False.
React ❤️ if you got it Right
📘Explanation:
An empty list [] is considered falsy in Python.
bool([]) converts the list to its Boolean value, which is False.
React ❤️ if you got it Right
🧠 Python MCQ Question
❓What will be the output of the following? >>print(",".join(["a", "b", "c"]))
❓What will be the output of the following? >>print(",".join(["a", "b", "c"]))
Anonymous Poll
31%
abc
20%
a,b,c
24%
a, b, c
24%
['a','b','c']