Phone capabilities and fitness monitoring
Answer:
Explanation:
The following code is written in Python. It asks the user for an input. Then cleans the input using regex to remove all commas, whitespace, and apostrophes as well as making it all lowercase. Then it reverses the phrase and saves it to a variable called reverse. Finally, it compares the two versions of the phrase, if they are equal it prints out that it is a palindrome, otherwise it prints that it is not a palindrome. The test case output can be seen in the attached picture below.
import re
phrase = input("Enter word or phrase: ")
phrase = re.sub("[,'\s]", '', phrase).lower()
reverse = phrase[::-1]
if phrase == reverse:
print("This word/phrase is a palindrome")
else:
print("This word/phrase is NOT a palindrome")
Answer:
Array: (a) All the messages a user has sent.
Variable: (b) The highest score a use has reached on the app. (c) A username and password to unlock the app.
Explanation:
An array generally has more than one value whereas a variable can only contain a single value at any particular point in time. In addition, a variable has a limit whereas an array does not have any maximum limit. Therefore, it can be concluded that option (a) will be stored as an array while options (b) and (c) will be stored as variables.
Tape a spoiler to the trunk.