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
Grace [21]
3 years ago
12

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

r of pennies. Ex: If you have $5.06 then the input is 5 6, and if you have $4.00 then the input is 4. Sample output with inputs: 5 6 4 506 400
Computers and Technology
2 answers:
KonstantinChe [14]3 years ago
7 0

Answer:

Code is given as:-

#number_of_pennies function with one default argument with pennies as 0 when no pennies parameter is given

def number_of_pennies(dollars,pennies = 0):

  pennies = dollars*100 + pennies #one dollar equals 100 pennies so calculate total pennies with this formula

  return pennies #return total pennies

print(number_of_pennies(int(input()),int(input()))) #both Dollars and pennies

print(number_of_pennies(int(input()))) #Dollars only

Explanation:

Here is the sample code and output.

katovenus [111]3 years ago
5 0

Answer:

The function is as follows:

def number_of_pennies(dollars,pennies=0):

   return dollars*100+pennies

   

Explanation:

This defines the function

def number_of_pennies(dollars,pennies=0):

This returns the number of pennies

   return dollars*100+pennies

<em>Note that, if the number of pennies is not passed to the function, the function takes it as 0</em>

You might be interested in
is a measurement that quantifies how much information can be transmitted over the network. A. Memory B. DMZ C. Bandwidth D. Clou
AnnZ [28]

Answer: Bandwidth....

6 0
3 years ago
A device receives a data link frame with data and processes and removes the Ethernet information. What information would be the
il63 [147K]

The information that would be the next to be processed by the receiving device is: IP at the internet layer.

<h3>Internet protocol (IP)</h3>

Internet protocol is a network protocol that help to transmit data to user device across the internet or network which inturn make it possible for user device to connect and communicate over the network.

Internet protocol at the internet layer is a TCP/IP software protocol which sole purpose is to transfer data packets across the internet after receiving and processing the data.

Inconclusion the information that would be the next to be processed by the receiving device is: IP at the internet layer.

Learn more about internet protocol here:brainly.com/question/17820678

7 0
2 years ago
What are some tips you can use when taking close up photos
Anit [1.1K]

Set your camera up on a tripod

Choose a subject (anything really)

Get your camera up close to the subject

Switch your camera to Manual focus. You can try auto focus, but generally you will be able to focus a little closer on manual focus.

(If you are using manual focus, the tripod will be important.)

4 0
3 years ago
Read 2 more answers
How good are vw beetle heaters in winter?
Vinvika [58]
It depends on the heater but in most case it works pretty well
7 0
3 years ago
How does a clock work
Free_Kalibri [48]

Sets of gears move inside of it that persicely move the hands onto the time. That's why watches can be so intricate and valuable.

If your looking for how to read one, it's pretty straightforward if you look it up online.

3 0
3 years ago
Read 2 more answers
Other questions:
  • How can a user begin working with a new, blank workbook in Excel?
    10·1 answer
  • Ok so sometimes when i do something i see a box with a question mark in it, how do i remove it, i am on a macOs High Sierra earl
    11·1 answer
  • Assume that someone dictates you a sequence of numbers and you need to write it down. For brevity, he dictates it as follows: fi
    14·1 answer
  • A(n) _____ is a computer network that uses Internet Protocol technology to share information, operational systems, or computing
    14·1 answer
  • Write a function named word_count that accepts a string as its parameter and returns the number of words in the string. A word i
    10·1 answer
  • Stuart wants to delete some text from a slide. What should Stuart do?
    8·1 answer
  • Which of the following is not part of the processes involved in data valida
    11·1 answer
  • When a called function completes its task, it normally:_________a. logs its results b. terminates program execution normally c.
    5·2 answers
  • Which of the following allows you to copy
    15·1 answer
  • I have a .NET 6 basic website that I built using Entity Framework as the database for updating pages. I am ready to deploy the s
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!