Answer:
(9F7, 9F8, 9F9, 9FA, 9FB, 9FC, 9FD, 9FE, 9FF, A00, A01, A02, A03)
Explanation:


This means that we must find all hexadecimal values from 2551 to 2563, or 9F7 to A03. You can convert from decimal to hexadecimal for each one, or just count.
We can define a word as a group of characters without a space between them. To find the words of the input string , w can use split(delimiter) which returns a list of strings which had the defined delimiter between them in the input string.
def countWords(string):
words = string.split(" ")
count = len(words)
return count
Here we set the delimiter as the space character, and returned the length of the words list. I split each step into its own line for readability, however the function could be one line:
return len(string.split())
Here, no delimiter is specified. If one isn't given, it will default to split at any whitespace, including space.
Answer:
Following is given the detailed solution to the question given.
- First image contains source code. All the steps are described with help of comments.
- Second image contains the output or the program given.
I hope it will help you!
Explanation:
By looking at your code, it seems like you're trying to let the user enter positive numbers until the user enters a negative number. To achieve this, you need to indent int(input("Enter a number, negative to stop")) inside the loop.
The second answer choice is correct.