1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
muminat
3 years ago
15

Create the strAnalysis() function that takes 1 string argument and returns a string message. The message will be an analysis of

a test string that is passed as an argument to strAnalysis(). The function should respond with messages such as:
"big number"
"small number"
"all alphabetic"
"multiple character types"
The program will call str_analysis() with a string argument from input collected within a while loop. The while loop will test if the input is empty (an empty string "") and continue to loop and gather input until the user submits at least 1 character (input cannot be empty).
The program then calls the str_analysis() function and prints the return message.
Sample input and output:

enter nothing (twice) then enter a word
enter word or integer:
enter word or integer:
enter word or integer: Hello
"Hello" is all alphabetical characters!

alphabetical word input:
enter word or integer: carbonization
"carbonization" is all alphabetical characters!

numeric inputs:
enter word or integer: 30
30 is a smaller number than expected

enter word or integer: 1024
1024 is a pretty big number
loop until non-empty input is submitted

Once the user gives input with characters use the input in calling the str_analysis() function.

Additional Details:
In the body of the str_analysis() function:

Check if string is digits
if digits: convert to int and check if greater than 99
if greater than 99 print a message about a "big number"
if not greater than 99 print message about "small number"
check if string isalpha then (since not digits)
if isalpha print message about being all alpha
if not isalpha print a message about being neither all alpha nor all digit
call the function with a string from user input

Run and test your code before submitting
# [ ] create, call and test the str_analysis() function
Computers and Technology
1 answer:
nydimaria [60]3 years ago
7 0

Answer:

def str_analysis(s):

   if s.isdigit():

       s = int(s)

       if s > 99:

           message = str(s) + " is a pretty big number"

       else:

           message = str(s) + " is a smaller number than expected"

       

   elif s.isalpha():

       message = s + " is all alphabetical characters!"

   else:

           message = "There are multiple character types"

   

   return message;

   

s = input("enter word or integer: ")

while s != "":

   print(str_analysis(s))

   s = input("enter word or integer: ")

Explanation:

- Check if the string is digit, alphabetical, or mixed inside the function

- Ask the user for the input

- Call and print the result of the <em>str_analysis</em> function inside the while loop

- Keep asking for the input until the given string is empty

You might be interested in
Which of the following defines guidelines that specify the way computers access the medium to which they are attached, the type(
mart [117]

Answer:

network standard

Explanation:

4 0
2 years ago
Which of the following type of software application would open a txt file
kogti [31]
I think that it's A or C
3 0
2 years ago
Read 2 more answers
What term identifies a blank screen or animation that automatically displays on a computer monitor after a specified period of i
Sveta_85 [38]
The answer is a screensaver
5 0
3 years ago
The RAM memory of a computer contains the volatile memory, which includes
lara31 [8.8K]

The RAM memory of a computer contains the volatile memory, which includes; Websites recently visited

<h3>Random Access Memory(RAM)</h3>

Random access memory (RAM) is defined as a computer's short-term memory that it utilizes to handle all active tasks and applications.

Now, no single program, file, game, or stream would work without a RAM. Thus, RAM is a temporary storage that goes away when we shut down the computer.

Examples of things that RAM store from the options given is only websites visited recently.

Read more about Random Access Memory at; brainly.com/question/86807

3 0
2 years ago
How can one protect against virus outbreaks in an organization?  What are the common causes of this problems?  How would use add
kobusy [5.1K]

<u>Virus outbreaks in an organization:</u>

In an organization end user who uses the computer or laptop or workstation is not aware of virus outbreaks. So As IT administrator of an organization she/he has aware of latest virus attack and rectification solution before outbreaks.

Common causes for this virus outbreaks problem is update virus definition or database. Update operating system patches on regular basis.

Installation appropriate anti-virus in each workstation or desktop or laptop and scheduling virus scanning and take necessary steps.

To address and troubleshoot disconnect workstation and desktop or laptop from LAN. Uninstalled unnecessary software, delete temp folder contents.

8 0
3 years ago
Other questions:
  • ____, developed by xuejia lai and james massey, is a block cipher that operates on 64-bit blocks of plaintext.
    10·1 answer
  • Jim, the IT director, is able to complete IT management task very well but is usually two weeks late in submitting results compa
    5·1 answer
  • Given the strings s1 and s2 that are of the same length, create a new string consisting of the first character of s1 followed by
    12·1 answer
  • A computer's hard disk drive holds 8 x 10^10 bytes of information. If Jill buys an extra memory stick that holds 5.1 X 10^8 byte
    10·1 answer
  • What should you do to organize a large amount of data??
    10·1 answer
  • Which feature allows users to see all suggestions for edits to a document at once?
    7·2 answers
  • Which of the following words best describes the word icon ​
    14·2 answers
  • Write the Python programs for the
    13·1 answer
  • when inserting a bibliography one choose from multiple ______ of bibliographies.[insert Bibliography]
    12·1 answer
  • Which is a software application used to analyze an organization’s data to improve decision making?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!