how to use function in python

Answers

Answer 1

Answer:

Use the keyword def to declare the function and follow this up with the function name.

Add parameters to the function: they should be within the parentheses of the function. ...

Add statements that the functions should execute.


Related Questions

How do you access the

internet in your school and at home?​

Answers

I think they want you to answer personally, but we access internet through computers, ipads, phones, etc. using wifi or mobile data to attain connection.

Help please
Who will give the answer I'll mark him/her as brainlist..​

Answers

Answer:

We will be using Average function of Excel Calculation sheet.

Its Syntax in Calc sheet is : =AVERAGE (number1, [number2], ...)

or you can use =Average and then click on the first cell and drag the whole row till end and close the brackets. It will calculate the average of that row.

Once you have applied average function on first row, you can drag this cell down the column and it will replicate the same function for respective rows.

A testing lab wishes to test two experimental brans of outdoor pain long each wiil last befor fading . The testing lab makes six gallon s of each paint to test. The resultare Shown to see how

Answers

Answer:

The answer is "[tex]\bold{Brand \ A \ (35, 350, 18.7) \ \ Brand \ B \ (35, 50, 7.07)}[/tex]"

Explanation:

Calculating the mean for brand A:

[tex]\to \bar{X_{A}}=\frac{10+60+50+30+40+20}{6} =\frac{210}{6}=35[/tex]

Calculating the Variance for brand A:

[tex]\sigma_{A}^{2}=\frac{\left ( 10-35 \right )^{2}+\left ( 60-35 \right )^{2}+\left ( 50-35 \right )^{2}+\left ( 30-35 \right )^{2}+\left ( 40-35 \right )^{2}+\left ( 20-35 \right )^{2}}{5} \\\\[/tex]

     [tex]=\frac{\left ( -25 \right )^{2}+\left ( 25 \right )^{2}+\left ( 15\right )^{2}+\left ( -5 \right )^{2}+\left ( 5 \right )^{2}+\left ( 15 \right )^{2}}{5} \\\\ =\frac{625+ 625+225+25+25+225}{5} \\\\ =\frac{1750}{50}\\\\=350[/tex]

Calculating the Standard deviation:

[tex]\sigma _{A}=\sqrt{\sigma _{A}^{2}}=18.7[/tex]

Calculating the Mean for brand B:

[tex]\bar{X_{B}}=\frac{35+45+30+35+40+25}{6}=\frac{210}{6}=35[/tex]

Calculating the Variance for brand B:

[tex]\sigma_{B} ^{2}=\frac{\left ( 35-35 \right )^{2}+\left ( 45-35 \right )^{2}+\left ( 30-35 \right )^{2}+\left ( 35-35 \right )^{2}+\left ( 40-35 \right )^{2}+\left ( 25-35 \right )^{2}}{5}[/tex]

    [tex]=\frac{\left ( 0 \right )^{2}+\left ( 10 \right )^{2}+\left ( -5 \right )^{2}+\left (0 \right )^{2}+\left ( 5 \right )^{2}+\left ( -10 \right )^{2}}{5}\\\\=\frac{0+100+25+0+25+100}{5}\\\\=\frac{100+25+25+100}{5}\\\\=\frac{250}{5}\\\\=50[/tex]

 Calculating the Standard deviation:  

[tex]\sigma _{B}=\sqrt{\sigma _{B}^{2}}=7.07[/tex]

Which tag is responsible for changing the text located in the tab of a web browser or when bookmarking a web site?
A.
B.
C.
D.

Answers

Answer:

d

Explanation:

The first form of the rocket is believed have been developed in _?
China
Germany
Greece
Poland
i will mark u brainliest mf

Answers

China in 1100 AD, if I am wrong I'm sorry.

Answer:

Greece

Explanation:

It is believed that the reaction principle, the physical law of rocket motion, was first demonstrated about 360 B.C. by a Greek named Archytas. Far from demonstrating the reaction principle in a weapon, Archytas simply filled a hollow clay pigeon with water. He then suspended the clay pigeon by string over a fire. The heating of the water produced steam, and the clay pigeon could move under its own power as steam escaped through strategically placed holes. Archytas could hardly have imagined that the same basic principle would one day carry men to the Moon.

If your query is 'michael kors women's handbags' and the Product Ad shows 'Womens Burlington handbags', What should be your rating? A) Bad B) Fair C) Good D) Excellent

Answers

My rating would be C) Good, it recommended me a similar handbag, good algorithm but not excellent because it’s not what I was looking for

Design a TestScores class that has fields to hold three test scores. The class should have a constructor, accessor and mutator methods for the test score fields, and a method that returns the average of the test scores. Demonstrate the class by writing a separate program that creates an instance of the class. The program should ask the user to enter three test scores, which are stored in the TestScores object. Then the program should display the average of the scores, as reported by the TestScores object.

Answers

Answer:

Answered below

Explanation:

class TestScores {

double test1;

double test2;

double test 3;

public TestScores (double test1, double test2, double teat3){

this.test1= test1;

this.test2 = test2;

this.test3 = teat3;}

//mutator

public setTest1(double test1){

this.test1 = test1;

}

//accessor

public double getTest1(){

return test 1;

}

//Write same accessors and mutators for test2 and test3

public double getTestAverage(){

double sum = test1+test2+test3;

return sum / 3;

}

}

class TestRun{

public static void main (String [] args){

TestScores scores = new TestScores(50.5, 40.0, 80.7)

int average = scores.getTestAverage();

System.out.print(average);

}

What is the author's purpose for writing this article? A to persuade readers to consider a career in aerospace engineering and at NASA B to caution readers about the difficulties that aerospace engineers encounter C to highlight the experiences of Tiera Fletcher growing up and as an aerospace engineer D to promote Tiera Fletcher's book and her nonprofit organization, Rocket With The Fletchers

Answers

Answer:

C to highlight the experiences of Tiera Fletcher growing up and as an aerospace engineer

Explanation:

Dream Jobs: Rocket Designer, a Newsela article by Rebecca Wilkins was written with the intent of informing the readers of how Tiera Fletcher developed a love for mathematics at an early age and further developed a desire to be a Space Engineer which she succeeded at. She highlighted the different steps she took before she realized her goal. Some of these steps included working as an intern in several space establishments and performing research.

Today, she is very successful in her career and hopes  that young ones can pursue a career in any STEM careers of their choice.

Answer:

c on newsella

Explanation:

What is "public static grossPay()" an example of?



A) Method()


B) Literal()


C) Private()


D) Order()

Answers

Answer:

A) Method()

Explanation:

This is an example of a Java method header. It has the visibility modifier called public which makes it visible to other classes. It is a static method which means it can be only be called through the Class's name because an object instance of it cannot be created. It is named grossPay and has no parameters and does not return any type.

Describe how a cell’s content and format attributes are related.

Answers

Answer: They are independent and not related.

Explanation: Changing the format affects the content. Which of the following is NOT a way to change the column width in Excel?

a cell's content and format are similar. a cell's content and format are unrelated. the content of a cell is influenced by changing its format. the format of the cell is also affected when the content of the cell is changed.

hope this helps

What is the difference between motion transmission and motion transformation?

Answers

Answer:

When the parts move in the same direction, it is rotational motion, and this is called motion transmission. When there is a change in the type the motion from rotation (circular or round and round) to translation (up/down), this is called motion transformation.

Explanation:

Answer:

When we convert a movement of one type into another of the same type (that is, linear in linear or circular in circular) we speak of transmission of movement. When, on the other hand, we convert it into another of another type (that is, linear in circular or circular in linear), we speak of transformation of movements.

Explanation:

Can someone help me with solving this program using coding?

Answers

Answer:

Explanation:

The following program is written in Python and holds all of the powers and amounts in a dictionary called inventory which can be changed, or the values can be increased like any dictionary. The data is then called and outputed to the user as an Inventory like the one shown in the picture.

def Inventory():

   inventory = {'Mushroom': 5, 'Super Bell': 5, 'Boomerang': 5, 'Fire Flower': 5}

   print("Mario's Inventory")

   print("Power            Amount")

   for x in inventory.keys():

       spaces = ''

       for y in range(20 - len(x)):

           spaces += " "

       print(x + spaces + str(inventory.get(x)))

Inventory()

7. Application software is a program or group of programs designed for end-users.
True
False

Answers

Answer:

True

Explanation:

A software refers to "instructions that tell a computer what to do. Software comprises the entire set of programs, procedures, and routines associated with the operation of a computer system" (Encyclopedia Britannica).

There are two types of software;

i) system software

ii) Application software

An application software helps the user to perform specific tasks on the computer. It was specifically designed for the end user.

A typical example of an application software is the Microsoft office which could be used to prepare documents using the computer.

Answer:

true

Explanation:

Can someone tell me how to hit on a link on Brainly to see the answer

Answers

no, please do not hit on links. they're viruses i'm pretty sure.
Make sure to report the answer just in case

Sharon wants to include her name on each slide in her science presentation. Where in the Header and Footer dialog box would she type her name?

Answers

Answer:

She will type her name in the Footer

Explanation:

To answer this question, I will assume Sharon is using the Microsoft Office PowerPoint package to handle her presentation.

In PowerPoint, the footer helps users to add names or any other details on every slide.

To do this:

Go to INSERT in the menu barThen, go to Text menuSelect Header & Footer to open the boxCheck the Footer optionEnter the text in the provided text box(This is where Sharon will enter her name)Lastly, click Apply to All to effect the changes

Distinguish between bit and byte?​

Answers

By its simplest definition, a bit is just a smaller unit of information than a byte. ... There are eight bits in one byte of information. Alternately, and more commonly in modern connotations, bits (and their successively larger relatives, such as kilobits, megabits and gigabits) are used to measure rates of data transfer.

materials used in front office

Answers

Answer:

A Telephone, Printer, Computers, Security Monitor

Which of the following statements is valid?SELECT InvoiceNumber, VendorNameFROM Invoices JOIN Vendors ON Invoices.VendorID = Vendors.VendorIDWHERE InvoiceTotal = MAX(InvoiceTotal)SELECT InvoiceNumber, VendorNameFROM Invoices JOIN Vendors ON Invoices.VendorID = Vendors.VendorIDWHERE InvoiceTotal = (SELECT MAX(InvoiceTotal))SELECT InvoiceNumber, VendorNameFROM Invoices JOIN Vendors ON Invoices.VendorID = Vendors.VendorIDWHERE InvoiceTotal IN (SELECT MAX(InvoiceTotal) FROM Invoices)All of the above

Answers

Correct Answer:

c.

SELECT InvoiceNumber, VendorName

FROM Invoices JOIN Vendors ON Invoices.VendorID = Vendors.VendorID

WHERE InvoiceTotal IN (SELECT MAX(InvoiceTotal) FROM Invoices)

Explanation:

All options only differ on the WHERE clause:

a: WHERE InvoiceTotal = MAX(InvoiceTotal)

Fails because aggregate functions (like MAX, COUNT, etc) have to be used on the SELECT clause.

b: WHERE InvoiceTotal = (SELECT MAX(InvoiceTotal))

Fails because the SELECT clause is incomplete.

c: WHERE InvoiceTotal IN (SELECT MAX(InvoiceTotal) FROM Invoices)

This one is correct, and returns the InvoiceNumber and VendorName register with the largest value on the InvoiceTotal field.

Brainliest for correct answer :)
a. X = A NOR B
b. X= NOT (A OR B)
c. X = A OR B

Answers

the answer is A, the logic circuit is a NOR

Fill in the blank to make the following true.
2 ** 3 =

Answers

Answer:

2 ** 3 = 8

Explanation:

Answer:

8

Explanation:

In the Business world people are often measured by their???
A- soft skills
B- hobbies
C- iq
D- technical skills

Answers

Answer:

D

Explanation:

You need skills to succeed!!

Answer is D !!!!!!!!

Which of the following tasks can you perform using a word processor?

insert a bulleted list in a document
check a document for spelling errors
edit a video for inclusion in a document
create an outline of sections to be included in a document
set a password to restrict access to a document

Answers

Answer:

check a document for spelling errors

Explanation:

With a word processor, you can easily edit and make changes to a document, move text around in a document, add images, change fonts, check for spelling errors

the processing is done in the​

Answers

Answer:

CPU Central Processing Unit

Answer:

CPU.... I'm not sure but it might be right or can u put the full question because it sorta don't make any sense

Website managers use____ every day.

Answers

Answer:

technology

Explanation:

Answer:

uses a coena for his computer association

What is wrong with the following recursive sum method? The method is supposed to sum up the values between 1 and x (for instance, sum(5) should be 5 + 4 + 3 + 2 + 1 = 15). public int sum(int x) { if (x == 0) return 0; else return sum(x – 1) + x; } Group of answer choices the base case should return 1 instead of 0 the recursive case should return sum(x – 1) + 1; instead of sum(x – 1) + x; the recursive case should return sum(x) + 1; the method should return a boolean instead of an int the base case condition should be (x <= 0) instead of (x = = 0)

Answers

Answer:

The base case condition should be (x <= 0) instead of (x = = 0)

Explanation:

The given recursive function works fine for positive number. However, it returns an error when the value passed to the function is negative.

To prevent this, the base case should be x <= 0.

This will allow the program returns 0 if a negative number or 0 is passed to the function.

Hence, the changes to be made is to replace the base case with x <= 0

Which of the following items are not a
component of a graphical user
interface?
(A) windows
(B) icons
(C) menus
(D) prompts​

Answers

Answer:

D

Explanation:

we dont use prompts on graphical iser

Prompts​ following items are not a component of a graphical user interface.

What is Graphical user interface?

A mouse is used to interact with a graphics-based operating system interface, which uses menus and icons to govern user interaction. The Xerox GUI was made popular in the 1980s by the Apple Macintosh.

However, Microsoft Windows, the company's GUI, has since become the standard user interface for personal computers. At the time, Microsoft's operating system, MS-DOS, required the user to input particular commands (PCs).

A graphics library, an interface toolkit, an interface style guide, and standardized applications make up a complete GUI environment. A high-level graphics programming interface is offered by the graphics library.

Therefore, Prompts​ following items are not a component of a graphical user interface.

To learn more about Graphical user, refer to the link:

https://brainly.com/question/14758410

#SPJ2

What is the purpose of the website directory provided by the website host?

A. to look up user account information
B. to provide help and training for new customers
C. to store all of a website’s content files
D. to archive website usage logs

Answers

Answer:

mabye A

Explana

.

.

.

What is one example of a pan lan man and a wan

Answers

Answer:

A LAN (local area network) is a group of computers and network devices connected together, usually within the same building. ... A WAN (wide area network), in comparison to a MAN, is not restricted to a geographical location, although it might be confined within the bounds of a state or country.

Explanation:

i hope this helps

Examples of system software include operating systems like macos, Linux, Android and
Microsoft Windows, computational science software, game engines, industrial automation, and
software as a service applications
True
False

Answers

Tru tru tru tru tru tru

It is important to reflect on feedback.
A. True
B. False

Answers

The answer is A. True

Answer:

YES ITS IS!!

Explanation:

Effective feedback assists the learner to reflect on their learning and their learning strategies so they can make adjustments to make better progress in their learning.

Other Questions
who is lorraine warren & Edward Warren. Find the Area:16 m.12 m You are given an array of arrays a. Your task is to group the arrays a[i] by their mean values, so that arrays with equal mean values are in the same group, and arrays with different mean values are in different groups. Each group should contain a set of indices (i, j, etc), such that the corresponding arrays (a[i], a[j], etc) all have the same mean. Return the set of groups as an array of arrays, where the indices within each group are sorted in ascending order, and the groups are sorted in ascending order of their minimum element.ExampleFora = [[3, 3, 4, 2], [4, 4], [4, 0, 3, 3], [2, 3], [3, 3, 3]]the output should bemeanGroups(a) = [[0, 4], [1], [2, 3]]mean(a[0]) = (3 + 3 + 4 + 2) / 4 = 3;mean(a[1]) = (4 + 4) / 2 = 4;mean(a[2]) = (4 + 0 + 3 + 3) / 4 = 2.5;mean(a[3]) = (2 + 3) / 2 = 2.5;mean(a[4]) = (3 + 3 + 3) / 3 = 3.There are three groups of means: those with mean 2.5, 3, and 4. And they form the following groups:Arrays with indices 0and 4 form a group with mean 3;Array with index 1 forms a group with mean 4;Arrays with indices 2and 3 form a group with mean 2.5.Note that neithermeanGroups(a) = [[0, 4], [2, 3], [1]]normeanGroups(a) = [[0, 4], [1], [3, 2]]will be considered as a correct answer:In the first case, the minimal element in the array at index 2 is 1, and it is less then the minimal element in the array at index 1, which is 2.In the second case, the array at index 2 is not sorted in ascending order.Fora = [[-5, 2, 3], [0, 0], [0], [-100, 100]]the output should bemeanGroups(a) = [[0, 1, 2, 3]]The mean values of all of the arrays are 0, so all of them are in the same group.Input/Output How did Battle of Britain change the tide of the war WW2 An object's speed is 0.8 m/s, and its momentum is 200 kg-m/s What is the mass of the object?A. 250kg B. 200kgC.160kgD.128kg Find the slope of the line that passes through (4, 1) and (9, 8). HEEEEEEEELLLLLLPPPPP PLLLLLZZZZZ T^T In your own words, explain what happens in the water cycle A car travels 30 1/5 miles in 2/3 of an hour. Whwt is the average speed, in miles per hour, of the car Write the equation for each graph. PLEASE HELP ME ON BOTH !! Cynthia, a sole proprietor, was engaged in a service business and reported her income on the cash basis. On February 1, 2013, she incorporates her business as Dove Corporation and transfers the assets of the business to the corporation in return for all of the stock in addition to the corporations assumption of her proprietorships liabilities. All of the receivables and the unpaid trade payables are transferred to the newly formed corporation. The balance sheet of the corporation immediately after its formation is as follows: Dove Corporation Balance Sheet February 1, 2013Assets Basis to Dove Fair Market ValueCash $ 80,000 $ 80,000Accounts receivable 0 240,000Equipment (cost $180,000; 120,000 320,000 depreciation previously claimed $60,000)Building (straight-line depreciation) 160,000 400,000Land 40,000 160,000Total $400,000 $1,200,000Liabilities and Stockholders EquityLiabilities:Accounts payabletrade $ 120,000Notes payablebank 360,000Stockholders equity:Common stock 720,000Total $1,200,000Discuss the tax consequences of the incorporation of the business to Cynthia and to Dove Corporation. Please help with this Match the following items.1. secretes digestive enzymes into the small intestine 2. the sac around the heart 3. digestion and absorption of food 4. intestinal flora 5. hydrochloric acid to digest food 6. fingerlike projections for absorption of nutrients 7. stores bile 8. secretion for digestion in mouth 9. reabsorption of needed materials by the kidney 10. filtration of wastes from the blood small intestinepancreastubules pericardium gall bladder stomachlarge intestineBowman's capsule villi Please help whats the domain of C President hoover wanted state and city governments rather than the federal governments to provide money directly to impoverished families known as 7. Which of the following statements about the albatross is best supportedby the passage below: At length did cross an albatross, Through the fog itcame; As if it had been a Christian soul, We hailed it in God's name. It atethe food it ne'er had eat, And round and round it flew.T. he ice did splitwith a thunder-fit;The helmsman steered us through! *A The albatross had been sent by a rescue team to retrieve the missing vessel.B The albatross pestered the crewmen every day for food.C The albatross was very picky about the food it ateD. The albatross was seen by the sailors as a good omen. A checking account has a balance of $350 a customer makes Cu with drawls 150 more than the other then he makes a deposit of 75 what is the answer You bought $2000 worth of stocks in 2012. The value of the stocks has been decreasing by 10% each yearPart AWrite an exponential function to represent this scenario...Format for answer...A(T) = a (1 + r)Part BWhat will your stock be worth in 2017? Round your answer to the nearest cent. What is the range of the ordered pairs (1,1), (2,6), (3,5), and (4,1)? Brainliest if correct