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
11. Written and artistic expressions are protected by
Lina20 [59]

Answer:

B

Explanation:

Written and artistic expressions are protected by intellectual property law.

8 0
2 years ago
Put your snap in the comments below if you want to be friends
jok3333 [9.3K]

Answer:

I don't have S nap, but my ensta is  brandnewmillennium

Explanation:

4 0
3 years ago
Read 2 more answers
Write at leaat 20 shortcuts on the Microsoft word.​
Flauer [41]

Answer:

Open a document: Ctrl + O.

Create a new document: Ctrl + N.

Save the current document: Ctrl + S.

Open the Save As window: F12.

Close the current document: Ctrl + W.

Split the window: Alt + Ctrl + S.

Copy: Ctrl+C

Paste: Ctrl+V

Cut the current selection: Ctrl + X

Copy the current selection: Ctrl + C

Paste the contents of the clipboard: Ctrl + V

Bold: Ctrl + B

Italics: Ctrl + I

Underline: Ctrl + U

Underline words only: Ctrl + Shift + W

Center: Ctrl + E

Make the font smaller: Ctrl + [

Make the font bigger: Ctrl + ]

Change text to uppercase: Ctrl + Shift + A

Change text to lowercase: Ctrl + Shift K

Insert a page break: Ctrl + Enter

Add a hyperlink: Ctrl + K

Explanation:

3 0
2 years ago
How many times do you need to click the format painter button to apply copy formats to multiple paragraphs one right after the o
IRISSAK [1]
U have to double-click for multiple paragraphs instead of single click

5 0
3 years ago
Which security measure provides protection from IP spoofing?
anyanavicka [17]

Answer:

An SSL also provides protection from IP spoofing.

8 0
3 years ago
Other questions:
  • The rmdir command (with no options) can only remove empty directories <br> a. True <br> b. False
    14·1 answer
  • To keep your audience interested in your speech, you should provide them with as many details as possible about the topic.
    12·1 answer
  • What does the do not disturb button do on the iphone?
    12·1 answer
  • How can a professional association help you reach your career goals?
    5·1 answer
  • Which of the following are characteristics of a cell
    12·1 answer
  • What are the disadvantages of using pointers?
    6·1 answer
  • Help plz
    10·1 answer
  • Please answer this question​
    12·1 answer
  • I’ll give brainliest if answers are correct
    11·1 answer
  • Why do we need operating systems?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!