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
  • 6

1 Answers1

1
text='hi how are you'
example=text.split()
print(' '.join(example[0:4:2]))
hiro protagonist
  • 40,708
  • 13
  • 78
  • 98