Python Learning
5.92K subscribers
451 photos
1 video
63 files
109 links
Python Coding resources, Cheat Sheets & Quizzes! 🧑‍💻

Free courses: @bigdataspecialist

@datascience_bds
@github_repositories_bds
@coding_interview_preparation
@tech_news_bds

DMCA: @disclosure_bds

Contact: @mldatascientist
Download Telegram
What will be the output of the following Python code?

print("xyyzxyzxzxyy".count('xyy', 0, 100))
Anonymous Quiz
44%
2
18%
0
16%
1
22%
error
What will be the output of the following Python code?

print("xyyzxyzxzxyy".count('xyy', 2, 11))
Anonymous Quiz
32%
2
19%
0
38%
1
12%
error
2🔥1
What will be the output of the following Python code?

print("xyyzxyzxzxyy".count('xyy', -10, -1))
Anonymous Quiz
26%
2
31%
0
18%
1
25%
error
What will be the output of the following Python code?
print('abc'.encode())
Anonymous Quiz
38%
abc
31%
‘abc’
20%
b’abc’
11%
h’abc’
What is the default value of encoding in encode()?
Anonymous Quiz
37%
ascii
16%
qwerty
42%
utf-8
5%
utf-16
What will be the output of the following Python code?

print("xyyzxyzxzxyy".endswith("xyy"))
Anonymous Quiz
14%
1
72%
True
7%
3
8%
2
What will be the output of the following Python code?

print("xyyzxyzxzxyy".endswith("xyy", 0, 2))
Anonymous Quiz
8%
0
17%
1
46%
True
29%
False
🤯1
What will be the output of the following Python code?

print("ab\tcd\tef".expandtabs())
Anonymous Quiz
50%
ab  cd  ef
22%
abcdef
12%
ab\tcd\tef
16%
ab cd ef
👍2
What will be the output of the following Python code?

print("ab\tcd\tef".expandtabs(4))
Anonymous Quiz
65%
ab  cd  ef
12%
abcdef
7%
ab\tcd\tef
16%
ab cd ef
What will be the output of the following Python code?

print("ab\tcd\tef".expandtabs('+'))
Anonymous Quiz
40%
ab+cd+ef
38%
ab++++++++cd++++++++ef
15%
ab cd ef
7%
none of the mentioned
2
What will be the output of the following Python code?

print("abcdef".find("cd") == "cd" in "abcdef")
Anonymous Quiz
57%
True
24%
False
15%
Error
5%
None of the mentioned
What will be the output of the following Python code?

print("abcdef".find("cd"))
Anonymous Quiz
41%
True
38%
2
9%
3
13%
None of the mentioned
👍2
What will be the output of the following Python code?

print("ccdcddcd".find("c"))
Anonymous Quiz
41%
4
40%
0
12%
Error
7%
True
What will be the output of the following Python code?

print("Hello {0} and {1}".format('foo', 'bin'))
Anonymous Quiz
65%
Hello foo and bin
20%
Hello {0} and {1} foo bin
10%
Error
5%
Hello 0 and 1
What will be the output of the following Python code?

print("Hello {1} and {0}".format('bin', 'foo'))
Anonymous Quiz
51%
Hello foo and bin
36%
Hello bin and foo
9%
Error
4%
None of the mentioned
What will be the output of the following Python code?

print("Hello {} and {}".format('foo', 'bin'))
Anonymous Quiz
69%
Hello foo and bin
16%
Hello {} and {}
8%
Error
7%
Hello and
What will be the output of the following Python code snippet?

print('{:,}'.format(1112223334))
Anonymous Quiz
40%
1,112,223,334
24%
111,222,333,4
13%
1112223334
23%
Error
👍1
What will be the output of the following Python code snippet?

print('{:,}'.format('1112223334'))
Anonymous Quiz
46%
1,112,223,334
23%
111,222,333,4
12%
1112223334
18%
Error
👍4
What will be the output of the following Python code snippet?

print('{:$}'.format(1112223334))
Anonymous Quiz
32%
1,112,223,334
28%
111,222,333,4
15%
1112223334
25%
Error
What will be the output of the following Python code snippet?

print('{:#}'.format(1112223334))
Anonymous Quiz
21%
1,112,223,334
31%
111,222,333,4
13%
1112223334
35%
Error