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
2. It enables you to gather data on a specific topic. *a.Interviewb.Questionnairec.Surveyd.Research
Assoli18 [71]

Answer:

Explanation:

am pro

7 0
3 years ago
Question 2 if you have a slow computer, what are some possible culprits that could be causing this? select all that apply
Simora [160]

Answer:

too many programs running, computer virus, lack of memory, to much cache

Explanation:

4 0
2 years ago
Which of the following is an acronym? A.RAM B.Every Good Boy Does Fine. C.association D.mnemonic device
neonofarm [45]

RAM is an acronym in the given following.

A.RAM

<u>Explanation:</u>

From the given options,  RAM stands for Random Access Memory. RAM comes under primary memory and is a volatile memory, which means the contents of a RAM are lost when the power is turned off.

The man function of RAM is to hold the data when it is being processed. Whenever the user tries to access a program or data, the control unit looks for the program first in the cache memory and then in the RAM for faster access and execution.

If the program is nowhere to be found in the RAM then it is searched in the secondary memory.

7 0
3 years ago
Your mom is trying to save room on her hard drive and wants to uninstall some of her applications. She asks you how to do this.
Olegator [25]
Press on an application, and press Ctrl and D together on a keyboard which means delete or unistall.
Is the answer supposed to be more specific?
3 0
3 years ago
Read 2 more answers
Help me with this two questions please
AnnyKZ [126]

Answer:

1 is def... don't know about the other one though sorry

6 0
2 years ago
Other questions:
  • What feature did we use to quickly apply the formatting shown in this image?
    9·1 answer
  • Writing a program in a language such as c or java is known as _____ the program.
    10·1 answer
  • Which type of view is created from the following SQL statement? CREATE VIEW balancedue AS SELECT customer#, order#, SUM(quantity
    15·1 answer
  • bad word bad word bad word bad wordbad word bad wordbad word bad wordbad word bad wordbad word bad wordbad word bad wordbad word
    5·1 answer
  • Write the proghrams for the following:
    13·1 answer
  • A systems administrator is designing a directory architecture to support Linux servers using Lightweight Directory Access Protoc
    11·1 answer
  • Can anyone help and write a sample answer to this please x
    7·1 answer
  • Which of the following players is on offence
    9·1 answer
  • What is 1 st genaration of computer ​
    14·2 answers
  • A single access point, and the set of hosts it serves, is called a(n) ________. BSS BSSID ESS None of these
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!