Skip to content

Instantly share code, notes, and snippets.

@Raj39120
Created May 1, 2020 18:15
Show Gist options
  • Save Raj39120/868fe45b5c39e8b20b89f31e3a4661b2 to your computer and use it in GitHub Desktop.
Save Raj39120/868fe45b5c39e8b20b89f31e3a4661b2 to your computer and use it in GitHub Desktop.
import time
def practice_12():
a = list(input("Enter a list of numbers separated by commas over here: "))
time.sleep(1)
print("The program will print the first and last numbers of your list.")
time.sleep(1)
print(a[::len(a)-1])
practice_12()
you can also make another simpler solution from this code without the time.sleep and the text and use only the main part which is the print(a[::len(a)-1]) or return(a[::len(a)-1]) part
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment