What will be the output of the following Python code?
x = “abcdef”
i = “a”
while i in x:
print(‘i’, end = ” “)
a) no output
b) i i i i i i …
c) a a a a a a …
d) a b c d e f
Answer: b
Explanation: Here i i i i i … printed continuously because as the value of i or x isn’t changing, the condition will always evaluate to True. But also here we use a citation marks on “i”, so, here i treated as a string, not like a variable.
Related Posts
A _________________ index is the one which satisfies all the columns requested in the query without performing further lookup into the clustered index.
In _______________ index instead of storing all the columns for a record together, each column is stored separately with all other rows in an index.
If an index is _________________ the metadata and statistics continue to exists
What are composite indexes?
Does index take space in the disk?:
What is true about indexes?
Which one is true about clustered index?
Join The Discussion