Computer Science
For a given declaration in Python as s = "WELCOME", which of the following will be the correct output of print(s[1::2])?
- WEL
- COME
- WLOE
- ECM
Python Funda
8 Likes
Answer
ECM
Reason — The slicing will start from index 1 and return at every alternative step.
s[1] = E
s[3] = C
s[5] = M
output = ECM
Answered By
5 Likes
Related Questions
Which of the following four code fragments will yield following output?
Eina Mina Dika
Select all of the function calls that result in this output
- print('''Eina
\nMina
\nDika''') - print('''EinaMinaDika''')
- print('Eina\nMina\nDika')
- print('Eina
Mina
Dika')
- print('''Eina
Which of the following is valid arithmetic operator in Python :
- //
- ?
- <
- and
Which of the following is an incorrect Logical operator in Python?
- not
- in
- or
- and
Which of the following is not a Tuple in Python?
- (1,2,3)
- ("One","Two","Three")
- (10,)
- ("One")