edhesive 7.6 lesson practice python
def mystery(a, b = 8, c = -6):
return 2 * b + a + 3 * c
#MAIN
x = int(input("First value: "))
y = int(input("Second value: "))
z = int(input("Third value: "))
1) Suppose we add the following line of code to our program:
print(mystery(x))
What is output when the user enters 1, 1, and 1?
2)Suppose we add the following line of code to our program:
print(mystery(x, y, z))
What is output when the user enters 8, 6, and 4?
Answer:
(a) The output is -1
(b) The output is 32
Explanation:
Given: The above code
Solving (a): The output when 1, 1 and 1 is passed to the function
From the question, we have: print(mystery(x))
This means that only the value of x (which in this case is 1) will be passed to the mystery function
(a, b = 8, c = -6) will then be seen as: (a = 1, b = 8, c = -6)
[tex]2 * b + a + 3 * c = 2 * 8 + 1 + 3 * -6[/tex]
[tex]2 * b + a + 3 * c = -1[/tex]
The output is -1
Solving (b): The output when 8, 6 and 4 is passed to the function
From the question, we have: print(mystery(x,y,z))
This means that values passed to the function are: x = 8, y = 6 and z = 4
(a, b = 8, c = -6) will then be seen as: (a = 8, b = 6, c = 4)
[tex]2 * b + a + 3 * c = 2 * 6 + 8 + 3 * 4[/tex]
[tex]2 * b + a + 3 * c = 32[/tex]
The output is 32
If we add the line of code print(mystery(x)) and our input are 1, 1 and 1 the output will be -1.
If we add the line of code print(mystery(x, y, z)) and our inputs are 8, 6 and 4 the out put will be 32.
This is the python code:
def mystery(a, b = 8, c = -6):
return 2 * b + a + 3 * c
#MAIN
x = int(input("First value: "))
y = int(input("Second value: "))
z = int(input("Third value: "))
print(mystery(x))
#What is output when the user enters 1, 1, and 1?
#Suppose we add the following line of code to our program:
print(mystery(x, y, z))
#What is output when the user enters 8, 6, and 4?
The code is written in python
Code explanation:The first line of code defines a function named mystery with the argument a, b by default is equals to 8 and c is equals to -6 by default. Then the code return the product of b and 2 plus a and plus the product of 3 and c. x, y and z variable that stores the users input.Then we call the function mystery with a single argumentThen we call the function mystery with three argument x, y and z which are the users input.The first print statement with the input as 1, 1 and 1 will return -1
The second print statement with the input 8, 6 and 4 will return 32.
learn more on python code here: https://brainly.com/question/20312196?referrer=searchResults
16
is a built-in mathematical formula included in MS Excel,
A) Function
By del
C) Formula
D) Range
Which device is connected to a port on a switch in order to receive network traffic?
Answer:
"Passive IDS" is the appropriate answer.
Explanation:
A framework that is designed mostly for monitoring and analyzing internet traffic operations and alerting a user or administrator about possible bugs, as well as disruptions, is known to be passive IDS.This IDS cannot carry out certain preventive as well as remedial processes as well as operations by itself.How does the habit Win-Win, along with the concepts of inclusivity and diversity, help to grow an organization and help you to increase your growth mindset?
Answer:
teamwork or leadership skills
An organization is a collection of individuals who work together to achieve a common goal or specific purpose.
To fully understand how the effect of a win-win habit, inclusivity. and diversity can affect the growth of an organization and help increase the mindset of people working in an organization, we need to carefully examine each term.
A win-win habit views life as a collaborative situation rather than a competing arena. In all human relationships, a win-win habit is a state of mind and soul that seeks mutual gain. The solutions arrived to are useful and satisfactory to both parties. Therefore, an individual that portrays a win-win habit for his organization will definitely help the organization grow thereby increasing his growth mindset.By the term inclusivity, we mean the act or principle of ensuring and providing equal access to opportunities and resources for individuals who would be excluded due to their physical or mental impairments, class, gender. etc. In an organization where the term inclusivity is not excluded, the growth of the organization will be paramount and be at the core of every member of such an organization.Diversity entails understanding that each person is unique and acknowledging their distinct characteristics, as well as respecting their variances. The values that diversity will help such organizations to achieve include; teamwork, tolerance, and leadership.Therefore, we can conclude that: an organization with all these terms( habit Win-Win, along with the concepts of inclusivity and diversity) will not only grow spontaneously but add value, credibility, and integrity to the organization and help increase the mindset of the individuals in the organization.
Learn more about leadership here:
https://brainly.com/question/7177953?referrer=searchResults
WIRELESS DATA TRANSMISSION METHODS
Answer:
Infrared
802.11-based
802.15-based
Explanation:
Infrared:
It's short distance wireless transmission - for example tv remote control using infrared waves.
802.11-based:
Mostly used for wifi and things like that...
802.15-based:
It's a bluetooth standart wireless data transmission method.
write an algorithm that reads two values determines the largest value and prints the largest value with an identifying message in Python
Answer:
a = int(input("Input your first number: "))
b = int(input("Input your second number: "))
maximum = max(a, b)
print("The largest value: ", maximum)
Explanation:
The function max() can be used to find the maximum of two values
The algorithm in Python is given by:
v1 = input("Enter the first value: ");
v2 = input("Enter the second value: ");
if (v1 > v2):
print(v1, "is the largest value");
else:
print (v2, "is the largest value");
------------------------
The first step is reading the two variables, which is done with the following code.
v1 = input("Enter the first value: ");
v2 = input("Enter the second value: ");
------------------------
Then, we have to verify which one is the largest, using the if command, along with the identifying message.
if (v1 > v2):
print(v1, "is the largest value");
else:
print (v2, "is the largest value");
A similar problem is given at https://brainly.com/question/14233103
What are indications of a computer hardware problem? Check all that apply.
The printer is printing in black and white.
The keyboard keys are getting stuck.
The computer monitor is going blank.
The pointer of the mouse freezes.
The images on the monitor look sharp.
Answer:
The keyboard keys are getting stuck.
The computer monitor is going blank.
The pointer of the mouse freezes.
Explanation:
The keyboard keys are getting stuck, the computer monitor is going blank, and the pointer of the mouse freezes are indications of a computer hardware problem.
What is computer hardware?The physical components that comprise a computer system, such as the central processing unit (CPU), memory (RAM), hard drive, motherboard, power supply unit (PSU), and others, are referred to as computer hardware.
The keyboard keys becoming stuck, the computer monitor going blank, and the mouse pointer freezing are all signs of a hardware problem.
Physical damage to the keyboard or a problem with the keyboard's internal mechanism can both cause the keys to become stuck.
A faulty monitor, a loose or damaged cable, or a problem with the graphics card can all cause the computer monitor to go blank.
A problem with the mouse's pointer or a problem with the computer's USB port can both cause the mouse's pointer to freeze.
The printer printing in black and white, on the other hand, is most likely the result of a printer setting or a software issue.
Thus, the sharpness of the images on the monitor indicates that the monitor is working properly and does not necessarily indicate a hardware problem.
For more details regarding hardware, visit:
https://brainly.com/question/15232088
#SPJ2
Consider the following correct implementation of the insertion sort algorithm.
public static void insertionSort(int[] elements)
{
for (int j = 1; j < elements.length; j++)
{
int temp = elements[j];
int possibleIndex = j;
while (possibleIndex > 0 && temp < elements[possibleIndex - 1])
{
elements[possibleIndex] = elements[possibleIndex - 1];
possibleIndex--; // Line 10
}
elements[possibleIndex] = temp;
}
}
The following declaration and method call appear in a method in the same class as insertionSort.
int[] arr = {4, 12, 4, 7, 19, 6};
insertionSort(arr);
How many times is the statement possibleIndex--; in line 10 of the method executed as a result of the call to insertionSort ?
The statement possibleIndex--; in line 10 is executed 5 times
From the declaration, we have the following array:
int[] arr = {4, 12, 4, 7, 19, 6};
The length of the array is 6
The iteration in the insertionSort function is meant to be repeated from 1 to n - 1
In this case, we have: 1 to 5 (i.e. 6 - 1)
Hence, the statement possibleIndex--; in line 10 is executed 5 times
Read more about insertion sort at:
https://brainly.com/question/15263760
17. What data structure is used for depth first
traversal of a graph.
Answer:
Depth First Search (DFS) algorithm traverses a graph in a depthward motion and uses a stack to remember to get the next vertex to start a search, when a dead end occurs in any iteration.anation:
Which of the following gives the
customers better products that are not
offered by other competitors?
Select one:
a. Competitive advantage
b. Branding
C. Advertisements
d. Marketing Strategy
Answer:
a. Competitive advantage
Answer:
a. Competitive advantage
Explanation:
what internal commands can we use when in interactive mode? can we use CLS and CD?
Discuss the objectives of business 8 marks
Answer:
Objectives of Business – Profitability, Growth, Stability, Efficiency and Survival. Business means busy in some activities. Business means conducting activities such as – sale, purchase and manufacturing etc for profit and growth.
The main objectives that a business might have are: Survival – a short term objective, probably for small business just starting out, or when a new firm enters the market or at a time of crisis. Profit maximisation – try to make the most profit possible – most like to be the aim of the owners and shareholders.
Which system board has a 64-bit bus?
Answer: https://en.wikipedia.org/wiki/64-bit_computing
64-bit computing - Wikipediaen.wikipedia.org › wiki › 64-bit_computing
In computer architecture, 64-bit integers, memory addresses, or other data units are those that are 64 bits (8 octets) wide. Also, 64-bit central processing unit (CPU) and arithmetic logic unit (ALU) architectures are those that are based on processor registers, address buses, or data buses of that size. ... With no further qualification, a 64-bit computer architecture ...
History · 64-bit operating system... · 64-bit applications · 64-bit data models
Explanation:
Which of the displays could be represented by a single bit?
Note that there are 2 answers to this question.
Choose 2 answers:
A. The current day of the week
B. The current month (1-12)
C. The current hour (1-12)
D. The temperature unit indicator ("C" or "F")
E. The "PM"/"AM" indicator
F. The current date (1-31)
Answer:
E. The "PM"/"AM" indicator
and
D. The temperature unit indicator ("C" or "F")
Which of the following statements about malware protection are accurate? Select 3 options. Firewalls and anti-malware should be used together to provide a higher level of protection. Being cautious in your behavior and how you interact with your devices is just as important as technology-based malware protections. Apps from any source can be downloaded safely onto mobile devices, since the operating system will stop any malware infection. Popular anti-malware applications can locate and remove ALL malicious software. Updates for software and operating systems need to be installed regularly, so systems have up-to-date protection.
Answer:
Updates for software and operating systems need to be installed regularly, so systems have up-to-date protection.
Firewalls and anti-malware should be used together to provide a higher level of protection.
Being cautious in your behavior and how you interact with your devices is just as important as technology-based malware protections.
Explanation:
Hope this helps
The statements about malware protection that are accurate:
Firewalls and anti-malware should be used together to provide a higher level of protectionBeing cautious in your behavior and how you interact with your devices is just as important as technology-based malware protectionsUpdates for software and operating systems need to be installed regularly, so systems have up-to-date protection.Malware refers to the software that damages computers and destroys them. It should be noted that malware refers to malicious software. Examples of common malware include worms, viruses, spyware, ransomware, etc. It should be noted that anti-malware is used in order to protect computer systems from being infected with viruses.Read related link on:
https://brainly.com/question/24252756
what is information technology ?
Answer:
Information technology is the study, design, development, implementation, support or management of computer-based information systems—particularly software applications and computer hardware. IT workers help ensure that computers work well for people.
Explanation:
Who are the member banks?
application area of word processor?
Answer:
Typing, editing,and printing different types of document .Formatting text, paragraph , pages for making attractive document .Checking spelling and grammar of document for making it error free.Inserting and editing pictures , objects, etc.Adding watermark , charts , quick flip, etc.Examine the following code. (1 point) Object obj = new Integer (5); Which of the following statements is true? The declared type of obj is Object. The actual type is also Object. The declared type of obj is Integer. The actual type is Object. The declared type of obj is Object. The actual type is Integer. The declared type of obj is Integer. The actual type is also Integer. 2. Examine the following code. (1 point) class D {} class C extends D {} class B extends D {} class A extends B {} Which of the following statements will compile without error? OA a = new B(); OB b = new DO); OCC = new AO; OD d = new A);
Examine the following code.
(1 point) class One { public void print() { System.out.println("One"); } class Two extends One { public void print() { System.out.println("Two"); } class Three extends Two { public void print() { System.out.println("Three"); } Which of the following code fragments will compile without error and display something other than the word, "Three"? One w = new Three(); w.print(); Three x = new One(); x.print(); One y = new Two(); y.print(); Two z = new Three(); z.print();
(1 point) Suppose that class Alpha is the parent of Beta and Beta is the parent of Charlie. Method calculate() is defined in Beta and is inherited and overridden by Charlie. Which of the following code fragments shows a valid method call? Alpha k = new Beta(); k.calculate(); Alpha k = new Charlie(); k.calculate(); Beta k = new Charlie(); k.calculate();
Charlie k = new Object(); k.calculate(); 5. What is the output of the following program?
(1 point) public class Circle { private double radius; public Circle( double radius) { this.radius = radius; public static void main(String[] args) { Circle x = new Circle(5); Circle y = new Circle(5); Circle z = x; System.out.println(x.equals(y) + ", " + (x == z)); true, true true, false false, true false, false
6. Consider the following code. (1 point) ArrayList names = new ArrayList(); names.add("Alexa"); names.add("Bill"); names.add("Christine"); Which of the following statements will display, "Alexa"? System.out.println(names.get()); System.out.println(names.retrieve()); System.out.println(names.get(1)); System.out.println(names.retrieve (1));
Which of the following statements will display, “Alexa"? System.out.println(names.get(0); System.out.println(names.retrieve (0)); System.out.println(names.get(1)); System.out.println(names.retrieve(1));
7. Which field or method of the ArrayList class will return the number of elements stored in the ArrayList? (1 point) length length() size() capacity (1 point)
8. Which of the following sequences shows Java access modifiers in correct order from most restrictive to least restrictive? private, default, protected, public private, protected, default, public public, default, protected, private public, protected, default, private
9. Which of the following statements is true about the protected modifier? (1 point) A protected member can only be accessed by code in other classes in the same package. Not only can a protected member be accessed by code in other classes in the same package, it can also be inherited by a subclass, even if the subclass is in a different package. The public and protected modifiers are nearly identical except that protected level access can be turned on or off at runtime. The protected modifier should be used nearly all the time, even in combination with private and public, especially when sensitive data is involved.
10. Which of the following statements is true? (1 point) It is possible to create instances of a class marked final. It is possible to extend a class marked final. It is possible to override a method marked final. It is possible to override a method inherited from a class that is marked final. Finish Cancel
will give more point if you help
Will mark brainliest!!!!!! no bs answers
Explanation:
what is this this is very long question I cannot answer this right now I need time
1 is C. The declared type of obj is Object. The actual type is Integer
2 is D. D d =new A();
3 is C. one y = new Two();
4 is C. Beta k = new Charlie();
5 is C. false,true
6 is A. System.out.println(names.get(0));
7 is C. size()
8 is A. private, default, protected, public
9 is B. Not only can a protected member be accessed by code in other classes....
10 is A. It is possible to create instances of a class marked final.
Write an algorithm to the area of parallelogram
Answer:
base multiplied by the given height
parallelogram = base x height
I hope this helps a little bit.
Complete the statement below with the correct term.
Good group dynamics depend on having four key strengths represented on the team, including analytical skills,
creativity, patience for research, and the ability to
effectively
Answer:
I need this answer rn
Explanation:
Microsoft
The Lock Tracking option prevents someone from turning the Track Changes feature off without a ________________________ . [Lock and Unlock Change Tracking]
Question 4 options:
password
lock definition
filename
computer
Answer:
Password
Explanation:
just took the test got a A!
Read this outline for an argumentative essay about government.
1. People have different ideas about the role of government.
A. The primary_purpose of government is to provide social services.
2. Government should provide services for
people who are poor or elderly.
A. Government can effectively provide the services that poor and elderly people need.
B. Food stamps keep people from going hungry.
C. Medicare and Medicaid provide health care.
D. Some people believe social services are an entitlement and not a right,
but many people could not survive without them.
Government's main role is provide to social services, such as food stamps.
The underlined sentence in the outline is the
O claim.
• conclusion.
Answer:
First option.
Explanation:
The underlined sentence in the outline numbered 1 (People have different ideas about the role of government) is the introduction.
What is an introduction?The essential concept of an outline for a particular piece of writing, such as an essay, is presented in a single brief sentence for the body paragraphs. In this manner, it is positioned at the start and briefly summarizes the thesis of an article.
Because it appears at the beginning of the outline and contains the key notion that unifies all the other ideas offered in the subsequent phrases, the sentence with the asterisk (*) serves as the introduction. Government can effectively provide the services that poor and elderly people need.
Therefore, The underlined sentence in the outline numbered 1 (People have different ideas about the role of government) is the introduction.
Learn more about an introduction, here:
brainly.com/question/18119893
#SPJ5
ill try to post the program needed in comments
This assignment will use Practical Assignment-7 as a foundation. Modify the .py resulted fron Practical Assignment 7 to meet the following requirements:
- If the file name that the user inputs does not exist in the folder, the user should be asked to try again two times. If the input file is still missing after the third attempt, the program should exit with a message;
- Automatically delete the original file after the encryption is done; use the option where the deleted file is not recoverable;
- For the option requiring a password to encrypt and decrypt, if the decryption password is wrong, the user should be asked to try again two times. If the password is still wrong after the third attempt, the program should exit with a message;
Answer:
Explanation:
what program do we use for ths
which of the following is not an operating system a) boss b) window xp c) linux d) bindux
Answer:
boss is not an os
Explanation:
boss is a former of Linux hope this helped
Drag each label to the correct location on the image.
Identify the cell references in the formula.
absolute
reference
relative
reference
mixed
reference
Answer:
1.) Relative cell reference - A1
2.) Absolute cell reference - $D$2
3.) Mixed cel reference - $D2
Explanation:
In Microsoft Excel, cell references are very important and critical when dealing with formula. They can give you what you’re looking for or make your entire worksheet incorrect.
A cell reference is a cell address or a range of cell addresses that can be used in a formula.
There are three types of cell references and they are;
a) Relative reference
b) Absolute reference
c) Mixed reference
A relative cell reference is a cell reference that changes when you copy the formula to other cells. It s usually just a normal cell reference like A1, B2, C3. If a formula with a relative cell reference is copied down to other cells, the formula will change. That is a formula with a relative cell reference changes with respect to the cell which it is copied to.
An absolute reference does not change when you copy the formula to other cells. In absolute references, the dollar sign $ is used to “lock” both the row and column so that it does not change when it is copied to other cells. An example is $D$2.
Using a mixed cell reference, one is trying to see that only either the row or column changes with respect to other cells when they are copied. It is like “locking” either the column or the row while changing the other. Just like from the example, $D2 is a mixed cell reference where only the column is locked such that only the row changes when the formula is copied to other cells.
What are benefits of virtualizing servers ?
11. You are considered accepting a job offer at a company on the other side of the country, but are worried about the movies costs. What is your best strategy regarding moving costs?
a. Inquire whether the company pays for the relocation or moving but be prepared to receive a no for an answer.
b. Do not as about having your moving expenses paid by the company, as it can create an impression that you are not fully interested in the offer.
c. Consider moving expenses an investment into your future and assume the full cost of it.
d. Insist that you will only accept the offer if all moving costs are covered by the company.
12. In general, freelancing jobs offer all EXCEPT which of the following?
a. More flexibility to choose the projects you wish to work on
b. Higher salary per hour
c. More job security
d. More independence - you are your own boss
Some printers spray ink, while others use heat or lasers to create images.
(A) non-impact
(B) line
(C) impact
(D) hard-copy
Answer:
hard - copy
Explanation:
that's because my printers does this
and its soo cool
If you are running a server , which of the follow operating system would be best suited ?window 10 or macOS
Answer:
MacOS. MacOS is always better for developers with the linux-like commands. The powerful shell for hosting servers, downloading programs for the servers, and much more. Windows is easier to use for normal users, but does not have a good shell for running commands. But the best OS to run a server on is Linux. Over 90% of servers are hosted on some linux distribution. Probably most of them are Ubuntu
Please mark me as brainliest.