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 
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)))
Answer:
A global variable can have the same name as a variable that is declared locally within the function.
Explanation:
In computer program, we refer to a global variable as that variable that comes with a global perspective and scope, ensuring its visibility throughout the program, except it is shadowed. The set of this kind of variable is referred to as global state or global environment. One feature of global environment is that it can have similar name as a variable declared locally within the function.
Answer:
c. notes view
Explanation:
Assuming you're talking about a slideshow program, like Microsoft PowerPoint, the notes view lets you see the speaker notes.
The normal view is the one used normally to present the regular slideshow content, it's formatted for a screen view.
The handout view is same as normal view, but formatted for print.
The slide sorter view is a general overview of your presentation allowing you to move your pages around.
Answer:
Input: Keyboard, Mouse, Microphone, Gaming Controller
Output: Monitor, TV, Headphones, Speakers
Explanation:
Input Devices are used to send signals to the computer.
Output Devices use signals from the computer to give you information