Created
May 1, 2020 18:15
-
-
Save Raj39120/868fe45b5c39e8b20b89f31e3a4661b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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