Python Questions
5.33K subscribers
1 photo
7 links
Tasks for Beginners, Interview Questions, Regular expressions, simple coding problems, Quiz etc.

Useful Resources — »»» @python_resources_iGnani
Projects for Practice — »»» @python_projects_repository
Discussion Forum — »»» @python_programmers_club
Download Telegram
What is the output of this statement

print ((1,2,3) <(1,2,4))
Anonymous Quiz
53%
True
25%
False
4%
None
14%
Error
4%
None of the above
February 24, 2020
February 24, 2020
February 24, 2020
Which is faster in performance while searching around a million records plus?
Anonymous Quiz
23%
List
10%
Set
24%
Dict
20%
Tuple
13%
All have the same performance
9%
See the answer
February 25, 2020
February 25, 2020
What is the output of this statement?

16//3+16//-3
Anonymous Quiz
6%
1
51%
0
13%
-1
7%
True
13%
Invalid Statement
9%
Show the answer
February 26, 2020
February 26, 2020
y, z = 10, 15;
b = c = 0;
b = y - y + z; y -= (y + z); #What is the value of b & y respectively? Please Explain?
Anonymous Quiz
18%
15, 15
47%
15, -15
10%
-15, 15
14%
Error
10%
Show me the answer
February 27, 2020
February 27, 2020
x = 2,3

What is the value of x
Anonymous Quiz
22%
2
8%
3
41%
2, 3
23%
Error
7%
Show me the answer
February 27, 2020
What is the output of the following code (Python 3x). Explain why?

print (type (1/2))
Anonymous Quiz
13%
class int
5%
class number
62%
class float
9%
class decimal
4%
none of the above
6%
Show me the answer
February 28, 2020
prefix = "hello"
print(prefix, "world!")
# What is the output of the above code? Hint: There is no space in these two words.
Anonymous Quiz
45%
helloworld!
39%
hello world!
5%
world! hello
6%
world!hello
4%
None of the above
2%
Show me the answer
February 29, 2020
February 29, 2020
What is the output of the following program :
`print('cd'.partition('cd'))`
Anonymous Quiz
21%
('cd')
11%
('')
29%
('', 'cd', '')
10%
('cd', '')
28%
Show me the answer.
February 29, 2020
February 29, 2020
February 29, 2020
February 29, 2020
#answer to the question 👆is ————-»»» Dict

Q: Which is faster in performance while searching around a million records plus?

To clarify, both Set and Dict perform search quite fast due to both Set & Dict being implemented using hashtables.
However, Dict performs marginally better compared to Set, but when compared to List or tuple, the difference is huge.
March 1, 2020
x = 1.3 + 2.3
print(x == 3.6)
# what is the output? Can you explain?
Anonymous Quiz
15%
3.6
63%
True
14%
False
2%
1.3
1%
2.3
6%
Show me the answer
March 1, 2020
Which of the following functions will return an iterable object in Python 3+ ?
Anonymous Quiz
11%
len()
10%
ord()
16%
xrange()
44%
range()
8%
None of the above
11%
Show me the answer
March 2, 2020