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
Which Internet of Things (IoT) challenge involves the difficulty of developing and implementing protocols that allow devices to
dolphi86 [110]

Answer:

Option C i.e., Interoperability is the correct option

Explanation:

Interoperability performs for computers or its components for the purpose to communicate and it is important to improve the development of the Internet of Things. It performs the communication as well as share their services between computer or its components.

It also contains challenges occurred at the time of developing and implementing the protocols by which they communicate.

7 0
3 years ago
Who wrote the book of luke​
netineya [11]
Luke himself wrote t the book
5 0
2 years ago
The Internet has been around for quite a while, but it did not have much impact on our everyday lives until the appearance of th
pishuonlain [190]

Answer:

The answer is "WWW".

Explanation:

WWW stands for World Wide Web, It is a combination of all Internet resources and users, that uses the hypertext transfer protocol. It provides world information that is available on the internet that is the expression of human knowledge. It is also known as a domain name that introduces resources or individual instances of the entire collection.

6 0
3 years ago
Write the corresponding Python expression of the following mathematical expression.<br> 2π
Lady bird [3.3K]

Answer:

The code:

# Import math Library

import math

# Print the value of 2pi

print (math.pi * 2) ## output would be: 6.28318530718

Explanation:

6 0
3 years ago
Jeff types a sentence She wore a new dress yesterday. He erroneously typed w instead of e in the word dress. What is the accurac
antoniya [11.8K]
96 i believe i'm not too certain on this one
6 0
3 years ago
Read 2 more answers
Other questions:
  • Point: A Point in a two dimensional plane has an integer x coordinate value and an integer y coordinate value.
    12·1 answer
  • What is the difference between HTML and CSS? * 1. CSS is a markup language unlike HTML. 2. HTML is a backend technology and CSS
    12·2 answers
  • When Clara accesses the programs and documents on her computer by way of icons, she is said to be employing
    15·1 answer
  • Why does my Office Computer send packet #1? What device responds by sending back packet #2? What information does my Office Comp
    15·1 answer
  • This is more opinionated than question-based.
    7·1 answer
  • Write a program that will find the smallest, largest, and average values in a collection of N numbers. Get the value of N before
    13·1 answer
  • Which are advantages of using a server operating system?
    12·1 answer
  • 1. Implement the function dict_intersect, which takes two dictionaries as parameters d1 and d2, and returns a new dictionary whi
    8·1 answer
  • Complete the function to return the factorial of the parameter using recursion,
    10·2 answers
  • The landscape layout is more appropriate for leaflet. <br> TRUE OR FALSE
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!