Tech Python
239 subscribers
120 photos
10 files
179 links
Python Programming Hub | Learn & Master Python

Welcome to the perfect channel to learn Python Programming — from beginner to advanced!

For promotions & collaborations:
techbywedcoder@gmail.com

Join now and accelerate your Python journey!
Download Telegram
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
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)
🧠 Python MCQ Question

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
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)
🧠 Python MCQ Question

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
🧠 Python MCQ Question

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
🧠 Python MCQ Question

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']
Correct Answer: B) a,b,c

📘Explanation:

The join() method concatenates elements of the list using the string before the dot as a separator.

So ",".join(["a", "b", "c"]) joins the list with commas: "a,b,c".

React ❤️ if you got it Right
🧠 Python MCQ Question

What will be the output of the following? >>print(type({}))
Anonymous Poll
19%
<class 'list'>
26%
<class 'set'>
44%
<class 'dict'>
11%
<class 'tuple'>
Correct Answer: C) <class 'dict'>

📘Explanation:

In Python, {} creates an empty dictionary, not a set.

An empty set must be created using set().

So type({}) returns <class 'dict'>.

React ❤️ if you got it Right
🧠 Python MCQ Question

What will be the output of the following? >>print(len(set("hello")))
Anonymous Poll
44%
5
25%
4
6%
3
25%
Error
Correct Answer: B) 4

📘Explanation:

The string "hello" has the characters: h, e, l, l, o.

set("hello") removes duplicates: {'h', 'e', 'l', 'o'}.

len(...) returns the number of unique characters, which is 4.

React ❤️ if you got it Right
🧠 Python MCQ Question

What will be the output of the following? >>print([0]*3)
Anonymous Poll
77%
[0, 0, 0]
7%
[3]
4%
[0]*3
11%
000
Correct Answer: A) [0, 0, 0].

📘Explanation:

[0]*3 means repeat the list [0] three times.

So it creates a new list with three zeros: [0, 0, 0].

React ❤️ if you got it Right
🧠 Python MCQ Question

What will be the output of the following? >>print(all([True, 1, "non-empty"]))
Anonymous Poll
47%
True
17%
False
20%
"Not Empty"
15%
1
Correct Answer: A) True

📘Explanation:

The all() function returns True only if all elements in the iterable are truthy.

True, 1, and "non-empty" are all considered truthy values in Python.

So all([True, 1, "non-empty"]) returns True.

React ❤️ if you got it Right
🧠 Python MCQ Question

What will be the output of the following? >>print("Hello" * 3)
Anonymous Poll
54%
HelloHelloHello
18%
Hello*3
25%
Hello Hello Hello
3%
Error
Correct Answer: A) HelloHelloHello

📘Explanation:

In Python, multiplying a string by an integer repeats the string that many times. So "Hello" * 3 results in the string 'HelloHelloHello'. There's no space added automatically.


React ❤️ if you got it Right