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
Informs the network interface card to pass packets sent to that address to the ip stack so their contents can be read, and tells
Lesechka [4]
The answer to this question is Registration
Registration on the network interface will allow computer users all around the world to access a certain information stored within a certain address in that network which most people know as a website.
Today, to do a network registration, people just need to contact a hosting service that will take care of everything for us, and we just need to provide the content.


6 0
3 years ago
X = 10<br> y = 20<br> x &gt; y<br> print("if statement")<br> print("else statement")
Eduardwww [97]
I dont really understand what you want to do but im gonna answer it as if I understood it.

If x is 10 and y is 20 then y is larger than x
8 0
3 years ago
2. As a student (now or in college) name a way you can use Excel. How can that help you as a student?
Scilla [17]

Answer:

The more you try some simple Excel tips and tricks, the more comfortable you’ll be using advanced Excel tricks moving forward. In addition to helping you in college, these Excel tips and tricks can help you secure and retain a job after you graduate. In 2013, IDC published a white paper which was originally commissioned by Microsoft Corporation.

Explanation:

8 0
2 years ago
Compare computer virus and worm ​
Zina [86]

Answer:

You can say they're somewhat alike, since a worm wiggles into a tight spot, just like how a computer virus wiggles into your computer-

Hope this helps-

7 0
3 years ago
Read 2 more answers
The ________ of the operating system enables users to communicate with the computer system. Select one: A. user interface B. mod
Mumz [18]
The user interface of the operating system
8 0
3 years ago
Other questions:
  • A. True
    14·2 answers
  • What term best describes the way the dns name space is organized?
    9·1 answer
  • What feature of Windows Server allows for agentless authentication?
    7·1 answer
  • Who is responsible for ensuring the security of business systems and developing strategies and safeguards against attacks by hac
    9·1 answer
  • When Web users enter the URL www.CIWcertified.com in their browser address bar, they can access the official CIW Web site at the
    6·2 answers
  • An organization is assigned a Class-C network 200.120.80.0 and wants to form subnets for its threedepartments: D1 (60hosts), D2
    7·1 answer
  • Which of the following is NOT a safe skill you can use to reduce your risk
    11·2 answers
  • Write a program to display the roll number of students who have scored 100 in math. display appropriate message if none have sco
    5·1 answer
  • Convert octal number 2470 to decimal number
    14·2 answers
  • Part of the operating system core is responsible for controlling security, managing the file system, and providing a platform fo
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!