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
IrinaK [193]
3 years ago
6

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:20002Th

en the output is:1000 500 250Note: In Python 3, integer division discards fractions. Ex: 6 // 4 is 1 (the 0.5 is discarded).LAB ACTIVITY2.29.1: LAB: Divide by x0 / 10main.pyLoad default template...12''' Type your code here. '''
Computers and Technology
1 answer:
HACTEHA [7]3 years ago
5 0

Answer:

Following are the code to the given question:

user_num = int(input())#defining a variable user_num that takes input from user-end

x = int(input())#defining a variable x that takes input from user-end

for j in range(3):#defining for loop that divides the value three times

   user_num = user_num // x#dividing the value and store integer part

   print(user_num)#print value

Output:

2000

2

1000

500

250

Explanation:

In the above-given program code two-variable "user_num and x" is declared that inputs the value from the user-end and define a for loop that uses the "j" variable with the range method.

In the loop, it divides the "user_num" value with the "x" value and holds the integer part in the "user_num" variable, and prints its value.  

You might be interested in
You have dinner with your family and tell them that you have taken bcis. your mother tells you that she is proud of you and that
VikaD [51]
The answer is (D) <span>I'll show you how to set up a simple database with one table called 'recipes.' You'll be able to manage it and run simple queries on it to find specific recipes very quickly and easily. All you need is some rudimentary knowledge of access to get the job done.
</span>

Spreadsheets are not bad for number crunching. However, if you have lots of data, you may benefit from efficient data management tool. Replacing spreadsheets with databases help you manage data centrally, safely and securely. By employing a database, you can avoid making mistakes like miscounts and data entry errors.

Learning Access can be a little bit daunting and intimidating. Through self-dedication, one can conquer and learn to create simple but functional database.


4 0
4 years ago
Assume that the population of Mexico is 114 million and that the population increases 1.01 percent annually. Assume that the pop
AfilCa [17]

Answer:

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variables

   double mexico = 114;

   double usa = 312;

   double mexicoRate = .0101;

   double usaRate = .0015;

// calculate population after every year until mexico population exceed the usa populationn

   while (usa>mexico)

   {

// print the population

       cout<<"Mexico's population ::"<<mexico<<" million."<<endl;

       cout<<"USA's population ::"<<usa<<" million."<<endl;

// update the population

       mexico+=mexico*mexicoRate;

       usa-=usa*usaRate;

   }

return 0;

}

Explanation:

Declare and initialize mexico and usa with their initial population.Also declare and initial their increase and decrease rate.Find the population of both the  country each year until mexico population exceeds the usa population.

Output:

Mexico's population ::114 million.                                                                                          

USA's population ::312 million.                                                                                            

Mexico's population ::115.151 million.                                                                                      

USA's population ::311.532 million.

.

.

.

Mexico's population ::270.546million.                                                                                      

USA's population ::274.213 million.                                                                                        

Mexico's population ::273.278million.                                                                                      

USA's population ::273.802 million.

6 0
3 years ago
Which of the following would be least effective?
Goryan [66]

Answer:

Exponential

Explanation:

The growth of an exponential function will develop much faster than all other functions included in the options meaning the execution time will take longer. This makes exponential functions the least efficient.

4 0
3 years ago
The user does not need to highlight data within an Excel worksheet in order to remove conditional formatting. True or false
san4es73 [151]

True

Excel 2019 makes it easy to remove conditional formatting since users do not need to highlight data in order to remove it.

5 0
4 years ago
What is the function of HTML?
Anastaziya [24]

Explanation:

HTML is used to create web pages, documents.

hope this helps u

4 0
3 years ago
Read 2 more answers
Other questions:
  • A private local network, accessible only to an organization's staff, is known as an:
    12·2 answers
  • Your computer has gradually slowed down. What's the most likely reason?
    8·1 answer
  • Two technicians are discussing a resistance measurement. Technician A states that components being measured should be removed or
    10·1 answer
  • Next, Kim decides to include a diagram of a frog’s life cycle in her presentation. She wants to use an image that is part of a p
    15·2 answers
  • The acronym pies is used to describe improvised explosive devices (ied) components. pies stands for:
    13·2 answers
  • Advanced Electronics has employees who use a company website to share work. By posting on the website, employees are
    7·1 answer
  • It is where your cpu (processor) is installed
    10·2 answers
  • Guys how can i video my self from my laptop <br> my laptop is (lenovo)
    8·2 answers
  • PLS HELP WITH MY PYTHON HW ILL GIVE YOU BRAINLIEST
    12·1 answer
  • when I turn on my pc using a graphics card, it does give video, and everything is normal, but when I try to turn on my pc with t
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!