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
denis23 [38]
2 years ago
4

LAB: Divide input integers

Computers and Technology
1 answer:
Brums [2.3K]2 years ago
7 0
Mark Brainliest please


Answer:
# The user is prompted to enter number as dividend
# The received number is assigned to userNum
userNum = int(input("Enter the number you want to divide: "))
# The user is prompted to enter number as divisor
# The divisor is assigned to x
x = int(input("Enter the number of times to divide: "))
# divideNumber function is defined to do the division
def divideNumber(userNum, x):
# counter is declared to control the loop
counter = 1
# the while-loop loop 3 times
# the division is done 3 times
while counter <= 3:
# integer division is done
# truncating the remainder part
userNum = userNum // x
# the result of the division is printed
print(userNum, end=" ")
# the counter is incremented
counter += 1
# the divideNumber function is called
# the received input is passed as parameter
# to the function
divideNumber(userNum, x)
# empty line is printed
print("\n")
Explanation:
The // operator in python works like the / operator in C. The // operator returns only the integer part of division operation. For instance 6 // 4 = 1. The fraction part is discarded
You might be interested in
Publishing is copying Web pages and associated files to a Web<br> server. T or f
sineoko [7]
The answer would be true.
4 0
3 years ago
A computer is not connecting to certain network devices properly. the ip address information is as follows: ip address: 192.168.
larisa [96]
192.168 suggests class C networks which have a 24 bit netmask (255.255.255.0) but you haven't provided enough info, like the netmask of a working machine, to be definite.
3 0
3 years ago
Answer the questions given below, share your ideas.Use the space for your answer.
Bess [88]

Answer:

I would get rid of the machine and well

8 0
2 years ago
King(a. has eaten b.ate c.had eaten) when Airah called​
Alenkinab [10]

Answer:

c

Explanation:

king had eaten when Airah called

3 0
2 years ago
Examine about the Internal &amp; External Fragmentation methods give an example for each. essay​
Tju [1.3M]

Internal Fragmentation occurs when a process needs more space than the size of allotted memory block or use less space. External Fragmentation occurs when a process is removed from the main memory. Internal Fragmentation occurs when Paging is employed. External Fragmentation occurs when Segmentation is employed.

3 0
2 years ago
Other questions:
  • Which function should be used to display a value based on a comparison?
    11·1 answer
  • 10 points (sorry it won’t let me do more points)
    10·1 answer
  • 3.A ball is thrown into the air with an initial velocity of 15 m/s. a.How long does it take the ball to reach maximum height?b.W
    12·1 answer
  • The company where Derek works has tasked him with setting up and securing a SOHO router. He wants to make sure the wireless netw
    11·1 answer
  • Eric would like to have a color textbook that makes it look as if the character in an image is speaking. Which object should he
    14·1 answer
  • after clicking the start button on your computer screen desktop what option would you then select to examine system components y
    15·1 answer
  • The linear programming ingredient or blending problem model allows one to include not only the cost of the resource, but also th
    14·1 answer
  • I need 3 sentences on adware.<br> What they do and how they are a risk.
    5·1 answer
  • 1. What are the advantages and disadvantages of technology in communication?
    9·2 answers
  • Red + blue =<br>Red + green =<br>Magenta - blue =<br>Yellow - green =<br>Cyan - blue =​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!