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
Allushta [10]
3 years ago
7

g Write a function number_of_pennies() that returns the total number of pennies given a number of dollars and (optionally) a num

ber of pennies.
Computers and Technology
1 answer:
Gemiola [76]3 years ago
4 0

In python 3.8:

def number_of_pennies(dollars, pennies = 0):

   return (dollars * 100) + pennies

print(number_of_pennies(1))

def number_of_pennies(dollars, pennies = 0):  This defines are function and the pennies = 0 sets the default value of pennies equal to 0.

return (dollars * 100) + pennies. This returns the amount of pennies in any amount of dollars and pennies given by the user.

print(number_of_pennies(1)) This prints the return value of our function which is the number of pennies. We don't have to give a number for the amount of pennies because the default value is 0, but we still have to give a value to the dollars.

I hope this helps!

You might be interested in
The tax calculator program of the case study outputs a floating-point number that might show more than two digits of precision.
Aneli [31]

Answer:

TAX_RATE = 0.20

STANDART_DEDUCTION = 10000.0

DEPENDENT_DEDUCTION = 3000.0

gross_income = float(input("Enter the gross income: "))

number_of_dependents = int(input("Enter the number of dependents: "))

income = gross_income - STANDART_DEDUCTION - (DEPENDENT_DEDUCTION * number_of_dependents)

tax = income * TAX_RATE

print ("The income tax is $" + str(round(tax, 2)))

Explanation:

Define the <em>constants</em>

Ask user to enter the <em>gross income</em> and <em>number of dependents</em>

Calculate the <em>income</em> using formula (income = gross_income - STANDART_DEDUCTION - (DEPENDENT_DEDUCTION * number_of_dependents))

Calculate the <em>tax</em>

Print the <em>tax</em>

<em />

round(number, number of digits) -> This is the general usage of the <em>round</em> function in Python.

Since we need <u>two digits of precision</u>, we need to modify the program as str(<u>round(incomeTax, 2</u>)).

4 0
3 years ago
Give two examples of situations or applications where electrical circuits are used.
Pavlova-9 [17]

Answer:

lamps, electric motors

Explanation:

5 0
3 years ago
Using reliable internet sources, identify three ways we use analog and digital signals in our everyday lives.
Montano1993 [528]
Clocks maybe is the answer. I really don’t know
7 0
3 years ago
When is blue for when the instance in which the directory of compulsion in the air!
KATRIN_1 [288]
I think it’s what the other person said
7 0
3 years ago
Which two actions allow the System Administrator to limit Chatter access during roll-out to a subset of Salesforce users?
Wewaii [24]

Answer:

a. Edit a Profile to "Enable Chatter" for the subset of users.

b. Create a Permission Set with the "Enable Chatter" permission for the subset of users

Explanation:

There are two ways to limit Chatter access during roll-out to a subset of Sales force users

  • through user profiles
  • through permission sets

"Enable Chatter" permission is added to the user profiles and permission sets during Chatter profile based roll-out.

a.

  • The system Administrator has to log in as Sales force administrator to perform this action.
  • Then select Profiles from Setup.
  • Click on Edit for the custom user profile.
  • Tick the Enable Chatter check box in the Administrative Permissions section.

b.

  • Search through the Permission Sets in Setup.
  • System section appears. Select System Permissions in that section.
  • Click on the Edit button .
  • Tick the Enable Chatter check box.
5 0
4 years ago
Other questions:
  • How is an interpreter different from a compiler?
    6·2 answers
  • Input numbers and segregate them by placing their values into even or odd vectors based upon their value being even or odd. Then
    12·1 answer
  • Because a vector container uses a dynamically allocated array to hold its elements,
    5·1 answer
  • John, the network administrator of XYZ Corporation, is interested in changing the format of text from the American Standard Code
    10·1 answer
  • What two windows tools can you use to know how much ram is installed on your system?
    10·1 answer
  • is either the number of bits used to indicate the color of a single pixel, or the number of bits used for each color component o
    7·1 answer
  • Assume you use Bubble Sort to sort a list with 15 elements (i.e.n= 9). Exactly howmany comparisons do you use (in the worst case
    10·1 answer
  • What element of art does this photograph show? A. shape B. space C. form D. tone E. line
    14·1 answer
  • What happen if ignore the unsafe markings in hand tools in ict​
    12·1 answer
  • A smart card is?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!