2

my mind,from:

>>>text='hi how are you'
>>>example=text.split()
>>>print(example[0:4:2])

it would print a list

['hi', 'are']

my question, how to convert them? from list like above, to:

>>> hi are

if you got it, please answer.

ariamadeus
  • 53
  • 1
  • 1
  • 7

1 Answers1

1
text='hi how are you'
example=text.split()
print(' '.join(example[0:4:2]))
hiro protagonist
  • 44,693
  • 14
  • 86
  • 111