PYTHON script for the following things:
# Creates a variable and stores a string value that is at least 8 characters long. s = "This is my string" # Displays the value of the variable to the screen. print(s) # Displays the length of the string using the len() function. print(len(s)) # Displays the last 3 characters of the string by using the substring() function. print(s[-3:]) # Creates a list containing 8 elements (numbers or strings) and displays the list using the print() function. lst = [1,"two",3,"four","five",6,7,"eight"] print(lst)
Get Answers For Free
Most questions answered within 1 hours.