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
Misha Larkins [42]
3 years ago
9

Currently, this program will add 6 and 3 together, output the math problem and output the answer. Edit this code so that a rando

m number is generated from 1 - 10 (inclusive) for the variables a and b. Also, instead of adding the two numbers together, the edited program should multiply them, and output the proper math problem and answer. Be sure to update every line of code to reflect the changes needed.
import random

a = 6
b = 3

answer = a + b

print (str(a) + " + " + str(b) + " = " + str(answer))
Computers and Technology
1 answer:
Yakvenalex [24]3 years ago
6 0

I've included my code in the picture below. Best of luck.

You might be interested in
Which is the fastest method of sharing public folders?
Rasek [7]

Answer:

I'm stuck on this but the correct answers I would at-least pick is A and C I need more information about what operating system you have on the computer.

3 0
3 years ago
Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the gas cost for 10 miles, 5
omeli [17]

Answer:

The Following are the code to this question:

def cost(miles, milesPerGallon, dollarsPerGallon):##defining a method cost that accepts three parameter

   return miles / milesPerGallon * dollarsPerGallon# calculate cost and return it value  

milesPerGallon = float(input('Enter miles/Gallon value: '))#defining variable milesPerGallon for user input  

dollarsPerGallon = float(input('Enter dollars/ Gallon value: '))#defining variable dollarsPerGallon for user input

print('{:.5f}'.format(cost(10, milesPerGallon, dollarsPerGallon)))#call method and print its value

print('{:.5f}'.format(cost(50, milesPerGallon, dollarsPerGallon)))#call method and print its value

print('{:.3f}'.format(cost(400, milesPerGallon, dollarsPerGallon)))#call method and print its value

Output:

Enter miles/Gallon value: 20.0

Enter dollars/ Gallon value: 3.1599

1.57995

7.89975

63.198

Explanation:

In the above-given code, a method "cost" is defined, that accepts three value "miles, milesPerGallon, and dollarsPerGallon" in its parameter, and use the return keyword for calculating and return its value.

In the next step, two variable "milesPerGallon, and dollarsPerGallon" is declared, that use the input method with float keyword for input floating-point value.

After input value, it uses a print method with different miles values, which are "10,50, and 400", and input value to pass in cost method to call and print its return value.

5 0
3 years ago
Help please! I need help with this question, it’s very hard.
sasho [114]

Answer:

1. PRINTER

2.Proj

3.USB

4.CAM

7 0
3 years ago
Which security testing activity uses tools that scan for services running on systems? reconnaissance penetration testing network
Fiesta28 [93]

Answer:

Network mapping.

Explanation:

Network mapping seems to be the method of mapping the server visibly and rationally in order to determine the relations at mid of the network as well as the not same nodes.

  • Network mapping is the practice of security checking using software to search against services running on networks.
  • Network performance applications and software contains certain network mapping functions that customize the network
7 0
3 years ago
What is data mining ​
Vesna [10]

Answer:

Data mining is a process of extracting and discovering patterns in large data sets involving methods at the intersection of machine learning, statistics, and database systems.

5 0
3 years ago
Read 2 more answers
Other questions:
  • Which statement is true regarding the Quick Access toolbar?
    11·2 answers
  • write a c++program that allows the user to enter the last names of fivecandidates in a local election and the number of votes re
    15·1 answer
  • ________ symbol is used in the "Advanced" section of the time range picker to round down to nearest unit of specified time.
    8·1 answer
  • Describe how computer is in the last 35 years
    6·1 answer
  • The computer stores a program while the program is running, as well as the data thatthe program is working with, in _____.
    10·1 answer
  • Write a class named Episode. An instance of this episode class will represent a single episode of a TV show, with a title, a sea
    12·1 answer
  • Lube job---------$18.00
    14·1 answer
  • Write a SELECT statement that selects all of the columns for the catalog view that returns information about foreign keys. How m
    6·1 answer
  • What stipulates that the source code of any software published under its license must be freely available.
    14·1 answer
  • personalization allows customers to modify the standard offering, such as selecting a different home page to be displayed each t
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!