+ 1
ON splitting lesson in python, I have the right output but with extras added.
On the splitting lesson in python I am told to create a program that outputs the last thing in a input list. x = input() elements = x.split() #ENTER CODE HERE x = elements[::-1] y = x[0:1] print(y) Problem is when I use the code its the right answer but apparently it's looking the answer without the [' '] surrounding it. Is there a way to remove it?
3 Respuestas
0
If you don't mind me asking what's the difference between your code and mine. Mine is just the longer way to the answer correct? What part of my code adds the [' '] around the numbers?
0
Thank you so much for your help.