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
Digiron [165]
3 years ago
12

Write a pyhton program to calculate area of a circle?

Computers and Technology
1 answer:
marta [7]3 years ago
8 0

Answer:

The code to calculate the area of a circle is:

from math import pi

def circleArea(radius):

 if radius > 0:

   return pi * (radius ** 2)

 else:

   return None

if __name__ == '__main__':

 radius = 5

 print("Radius: {} Area: {}".format(radius,circleArea(radius)))

Explanation:

A detailed explanation of each line of code is given below.

#Define the number pi used to calculate the area

from math import pi

#We define a function that calculates the area of a circle

def circleArea(radius):

#Check if the radius is valid ( radius > 0) since there aren´t negative radius

 if radius > 0:

#Compute the area formula for a circle \pi * radius^{2}

   return pi * (radius ** 2)

 else:

#Return None if the radius is invalid

   return None

#Run the function we´ve defined

if __name__ == '__main__':

#Define a radius

 radius = 5

#Call the function and parse the radius through it, then print the result

 print("Radius: {} Area: {}".format(radius,circleArea(radius)))

You might be interested in
Which of the following is true about a hot site?
swat32

Answer:

Option(d) is the correct answer to the given question.

Explanation:

A hot site is a place off site in which the task of a corporation could restart during a massive failure.The hot site seems to have all the needed equipment for such the corporation to schedule the normal activities, such as phone jacks, replacement data, laptops, and linked devices.

  • The main objective of hot sites provide an useful backup mechanism for any corporation that wishes to pursue its business in the presence of exceptional circumstances or events.
  • All the others options are not related to hot site that's why they are incorrect option.
8 0
3 years ago
is an interviewing method in which a mall interviewer intercepts and directs willing respondents to nearby computers where each
geniusboy [140]

Answer:

computer-assisted self-interviewing

Explanation:

Based on the description of the interviewing method that is being provided, it can be said that this method is known as computer-assisted self-interviewing. Like mentioned in the question this is when interviewees answer the interview questions through a computer screen. This is similar to telephone interviews but it is instead through a computer.

3 0
3 years ago
The Boffo Balloon Company makes helium balloons. Large balloons cost $13.00 a dozen, medium-sized balloons cost $11.00 a dozen,
IceJOKER [234]

Answer:

name = input("Enter customer name: ")

quantity = int(input("Enter quantity: "))

size = input("Enter size [large-medium-small]: ")

if size == "large":

   sales = (quantity / 12) * 13

if size == "medium":

   sales = (quantity / 12) * 11

if size == "small":

   sales = (quantity / 12) * 8.6

   

print(name + " ordered " + str(quantity) + " " + size + " ballons")

print("Total sales is $" + str(sales))

Explanation:

*The code is in Python.

Ask the user to enter name, quantity, and size

Check the size using if structure. Depending on the size, calculate the sales using the given cost for for a dozen.

Print the order information and total sales

4 0
2 years ago
Today you turned on your computer after being on vacation for a week. You see spinning white dots on a black screen. You decide
Andre45 [30]

Answer:

<em>Use Safe Mode to boot</em>

Explanation:

Safe mode uses a <em>limited number of files and drivers to begin Windows in a simple form. If an issue does not arise in safe mode, this means that the problem is not caused by default settings and simple system drivers.</em>

Windows in safe mode helps users to track down the cause of a problem and therefore can enable users to solve problems on the computer.

The steps include:

  1. Reboot your computer.
  2. Click the F8 button before the logo appears on Windows 7 and above.
  3. Using the arrow keys to navigate and select which operating system you would like to boot into Safe Mode if you have more than one operating system installed on the same computer.
  4. Use the arrow keys to select Safe Mode and press Enter.

4 0
3 years ago
Specialized vocabularyis known as:
svet-max [94.6K]

Answer:

<u>"Jargon"</u>

Explanation:

Great question, it is always good to ask away and get rid of any doubts that you may be having.

<em>Specialized vocabulary</em> is sometimes also known as <u>"Jargon"</u> . These are sets of words that are used specifically and uniquely for specific sets of groups or organizations.

For example Lawyers Judges and other law enforcement officials have their own Specialized vocabulary that are better understood by other people in Law enforcement, people that are not part of Law Enforcement might have a hard time understanding.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

4 0
3 years ago
Other questions:
  • Use search engines and websites to research the following WAN technologies to complete the table below:
    7·2 answers
  • Explain one thing you will start doing as a passenger.
    10·2 answers
  • Plz help ASAP
    10·1 answer
  • Mercury Technical Solutions has been using SSL in a business-to-business environment for a number of years. Despite the fact tha
    5·1 answer
  • write a method that will return a person's age entered by keyboard. You will need to include at least one instance variable in t
    11·1 answer
  • Write a Java program in jGRASP that creates a 2D integer array of 5 rows and 20 columns, fills it with increasing integer values
    13·1 answer
  • An administrator has created a new custom object in a sandbox environment and now is ready to deploy in production. How can the
    11·1 answer
  • Computer privacy typically occurs when which of the following is violated?
    6·1 answer
  • ...................is a high level, structured , open source programming language​
    10·1 answer
  • Owen is writing a program that will lock his computer for one hour if the incorrect password is entered more than five times. Ha
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!