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
Degger [83]
4 years ago
9

including how it can be stored and what types of operations we can perform. For example, we can write a program that squares num

bers, but it wouldn’t be able to square a word.
Computers and Technology
1 answer:
ASHA 777 [7]4 years ago
6 0

Answer:

The solution code is written in Python:

  1. def square(num):
  2.    if type(num).__name__ == 'int':
  3.        sq_num = num * num
  4.        return sq_num  
  5.    else:
  6.        return "Invalid input"
  7. print(square(5))
  8. print(square("Test"))

Explanation:

To ensure only certain type of operation can be applied on a input value, we can check the data type of the input value. For example, we define a function and name it as <em>square</em> which take one input number, <em>num </em>(Line 1).

Before the <em>num</em> can be squared, it goes through a validation mechanism in by setting an if condition (Line 2) to check if the data type of the input number is an integer,<em> int.</em> If so, the<em> num </em>will only be squared otherwise it return an error message (Line 6).

We can test our function by passing value of 5 and "Test" string. We will get program output:

25

Invalid input

You might be interested in
use the internet to research the SYSTEM account. Why is it nessesary to include this account with full control on a directory
Kobotan [32]

Answer:

It is essential for the existence of a helicopter administration over all other users on the system.

 

Explanation:

A system account is a computer user account that is generated by an operating system (OS) during installation of the OS and that is utilized by the user in accordance to the parameters with which it has been designed and the purpose which it was created.

A System account is usually referred to as a privileged account because it comes with full control on one or more directories. A directory is simply a location for file storage on a computer. Full access or control includes the ability to:

  1. read directories
  2. write to directories
  3. make changes to and delete files, folder and subfolders.
  4. alter authorization settings for all files and subdirectories.

Besides control on the directory level, System Accounts which are also called Super Accounts which in addition to the above have permission to

  • install  and remove software applications
  • update and or upgrade the computers operating system
  • access directories and files which normal users cannot and should not.

System Accounts are therefore important for security reasons. They are configured to act as a supervisory account which can create, authorise and terminate other accounts and processes.

Some of their merits include the ability to:

  1. Oversee, audit, and completely control all other privileges.
  2. forestall cyber attacks on the system from internal users or insiders.
  3. Establish and provide evidence for compliance with regulatory codes

Cheers

8 0
3 years ago
Which of the following set of instructions defines an algorithm in the formal, strict sense?
Nikolay [14]
Hope that understands

8 0
3 years ago
Would you expect all the devices listed in bios setup to also be listed in device manager? would you expect all devices listed i
katen-ka-za [31]
<span>Would you expect all the devices listed in bios setup to also be listed in device manager? = Yes
Would you expect all devices listed in device manager to also be listed in bios setup? = No, the BIOS doesn't know anything about your peripherals etc. that is all managed by the OS.</span>
6 0
3 years ago
Karen works in a department store. Her coworker gave diverse cultural backgrounds. Which statement shows that Karen understand t
Goshia [24]

Answer:

Karen!

Explanation:

hahhahahahhahaahhahahaahahha

she wouldn't understand anything

anyways, where is the statements THEN I'll edit my answer シ

5 0
3 years ago
The encapsulation unit on the presentation layer of the osi model is
Zielflug [23.3K]
<span>The encapsulation unit on the presentation layer of the OSI model is the Data link layer (2).</span>
7 0
4 years ago
Other questions:
  • A data structure used to bind an authenticated individual to a public key is the definition of ________.
    14·1 answer
  • Write a static method named textcount that takes a scanner representing a file as a parameter and that reports various statistic
    11·1 answer
  • If you need to multiply 400, 2, and 1 ½, what would you type on the numeric keypad?
    9·2 answers
  • A computer is a multipurpose device that accepts input processes data and produces output all according to a series of stored
    8·1 answer
  • In statistics, what is the mode of a data set?
    6·2 answers
  • what is the definition of web search(ing)? when I look it up it keeps trying to give me definitions for search engines but that'
    10·2 answers
  • Which of the following is true regarding packaged software and custom software? Group of answer choices Packaged software are ap
    13·1 answer
  • How does a hard drive work
    6·2 answers
  • Making sure that your business has something special and distinct to offer is known as?
    12·1 answer
  • This function whose primary purpose is to display information to the user can only display one value at a time.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!