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
What is internet?<br>what is online?​
slavikrds [6]

Answer:

internet: The Internet is a vast network that connects computers all over the world. Through the Internet, people can share information and communicate from anywhere with an Internet connection.

online: controlled by or connected to a computer., while connected to a computer or under computer control.

3 0
3 years ago
The _____ row is typically the first row in a table.<br><br> banded<br> total<br> header<br> odd
rusak2 [61]

the first row of the table is know as the table header.

8 0
3 years ago
Read 2 more answers
What output is produced by the following code? Integer first = new Integer(7); Integer second = first; if (first == second) Syst
fenix001 [56]

Answer:

The correct output of this question is  "Sneezy Sleepy".

Explanation:

In the given code firstly we create the object of the integer class that is first in this we pass the integer value that is 7. Then we declare another second integer variable is this variable we pass object as a reference. Then we use the two conditional statements. In the first, if block we check that the object of the class is equal to the reference variable. If it is true it prints Sneezy. otherwise, it will print Grumpy. In second if block we check that the object of the class is equal to the reference variable. but in this time we the equals() function it is the same as(==). If the condition is true it prints Sleepy. otherwise, it will print Doc. So the output of the code is Sneezy Sleepy.

6 0
3 years ago
In which of the following situations may you pass on the right
Natasha2012 [34]
In driving your vehicle, it is best to pass on the right after you slow your vehicle down and check for the road whether there is an upcoming vehicle or not. When the road is clear, it is best and safe to pass on the right after making sure that the coast is clear.
3 0
3 years ago
Read 2 more answers
Josh wrote the following e-mail to his co-worker. PLEASE HELP QUWICK
Vedmedyk [2.9K]

Answer:

Answer choice 4

Explanation:

If Josh sends an e-mail to his... co-<em>worker</em>.... wouldn't that be... <em>work</em>place communication?

3 0
3 years ago
Read 2 more answers
Other questions:
  • PLEASE HELP PROGRAMMING WILL GIVE BRAINLIEST
    11·2 answers
  • What is computer? Explain the characteristics of computer.<br>​
    12·1 answer
  • Let’s say you’re publishing a message with the Hootsuite Composer. The message contains a link to a landing page, and you want t
    9·1 answer
  • How to change screen resolution in windows 10?
    5·1 answer
  • Each row in a database is a set of unique information called a(n) (A.)table,(B.)record,(C.)object,(D.)field
    12·2 answers
  • When you merge business letters, how many total documents will you have when you are finished with the merge process?
    13·2 answers
  • How to understand amortized analysis potential?
    12·1 answer
  • Write and test a Python program to find and print the largest number in a set of real (floating point) numbers. The program shou
    5·1 answer
  • Assume the existence of an UNSORTED ARRAY of n characters. You are to trace the CS111Sort algorithm (as described here) to reord
    14·1 answer
  • he degree of operating leverage is equal to: Group of answer choices FC / OCF. VC / OCF. 1 FC / OCF. 1 VC / OCF. 1 Picture FC /
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!