Computers and Technology

Write a program using integers user_num and x as input, and output user_num divided by x three times. Ex If the input is
2000
2
Then the output is
1000 500 250
Note: In Python 3, Integer division discards fractions. Ex 6 // 4 is 1 (the 0.5 is discarded)
LAB ACTIVITY: LAB: Divide by x
main. py Load default template
1 user_num int(input)
2 Xintinput)
3 for 1 in range (3)
4 user_num. user_num//
5 print(user_num)
6
1. Compare output ^
Output is nearly correct, but whitespace differs. See highlights below
Input
2000
2
Your output
1000
500
250
Expected output 1000|50|250
2. Compare output ^
Output is nearly correct, but whitespace differs. See highlights below.
Input
100
4
Your output
25
6
1
Expected output
25 |6|1|
3. Compare output ^
Output is nearly correct, but whitespace differs. See highlights below.
Input
8000
-2
Your output
-4000
2000
-1000
Expected output
- 4000|2000|-1000

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 14:40, davidb1113
You begin your first day of responsibilities by examining the recent is security breach at gearup to get ideas for safeguards you will take. at gearup, criminals accessed the company's improperly-secured wireless system and stole customers' credit card information as well as employee social security numbers. what kind of computer crime did gearup face?
Answers: 3
image
Computers and Technology, 23.06.2019 09:30, rscvsdfsrysas3712
Why is an outfitting a workspace with video games in a technology development company considered a strategic use of money
Answers: 1
image
Computers and Technology, 23.06.2019 12:00, muncyemily
From excel to powerpoint, you can copy and paste a. cell ranges and charts, one at a time. b. cell ranges and charts, simultaneously. c. charts only. d. cell ranges only.
Answers: 3
image
Computers and Technology, 23.06.2019 15:00, puppylove899
Barbara is interested in pursuing a career in the science and math pathway. which qualifications will her reach that goal? a. an advanced knowledge of physics and math b. an advanced knowledge of engineering and math c. an advanced knowledge of physics and robotics an d. advanced knowledge of machinery and math
Answers: 1
Do you know the correct answer?
Write a program using integers user_num and x as input, and output user_num divided by x three times...

Questions in other subjects:

Konu
Mathematics, 04.02.2020 02:49