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]
3 years ago
4

LAB: Divide input integers

Computers and Technology
1 answer:
Brums [2.3K]3 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
Which of the following is not a group of energy sources?
Dimas [21]

Answer:

nonrenewable

Explanation:

Brainliest please

4 0
3 years ago
Read 2 more answers
A program that helps computer users do specific things like word processing, etc., e-mailing, or browsing the Internet
Dimas [21]

This is an application

6 0
3 years ago
How to turn off do not disturb on iphone for a contact.
Tresset [83]

Answer:

Okay so you turn your phone on scroll up and it well show everything click the moon and on the side of your phone there is alittle swice turn it right

Explanation:

3 0
2 years ago
Read 2 more answers
HELP!! WHATS THE ANSWER??
dsp73

Answer:

"sing" that is the answer

Explanation:

6 0
3 years ago
Read 2 more answers
What should htc's os strategy be? should it stick with windows mobile and android? should htc build its own platform? add/drop o
rosijanka [135]

I say windows, since it is very common.

8 0
3 years ago
Other questions:
  • Two electronics students are discussing static electricity and electric current. Student A says that a basic property of static
    12·1 answer
  • On the Picture Tools Layout tab, you can preview results of the numerous styles, borders, effects, and layouts by _______ comman
    7·2 answers
  • A firewall is either software or dedicated hardware that exists between the __________ being protected.
    13·1 answer
  • 1.
    12·1 answer
  • You work as a Network Administrator for wwwpany Inc. You have suspected a bad driver or perhaps malware. Which of the following
    12·1 answer
  • A firm offers virtual local area networks and firewalls as an on-demand cloud service. Which service does the firm offer?
    11·2 answers
  • ______________ is a raw fact about a person or an object
    6·1 answer
  • A(n) __________ prevents outsiders from accessing corporate information the user does not want others to see.
    9·1 answer
  • 1. A truck leaves a stop sign and accelerates uniformly over a time of 5.21 seconds for a
    10·1 answer
  • What is multimedia hard ware? Write any four examples of multimedia hardware. <br>​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!