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
3. Which swim_backwards method is called when sammy.swim_backwards() is executed? Why?
Georgia [21]
Classes called child classes or subclasses inherit methods and variables
4 0
2 years ago
Which principle of design does a designer apply when they create rhythmic movement in a garment by using recurring pleats or det
WITCHER [35]

Answer:

Repetition, and regular rhythm

Explanation:

Its certainly repetition method, and repetition method is of three types which are repetition, pattern and rhythm.

Remember repetition can be boring at times as we need to read same thing again and again. However, repetition sometimes can be good like the one we are referring to, and the other one can be like placing the logo or menu at same place in all web page. And its since it creates a habit in us for reading the web pages, And hence we can understand faster, and it looks please to our eyes hence as well.  

4 0
3 years ago
Which option helps you choose the design of a slide in a presentation?
lozanna [386]
Hello! The slide transition helps with the transitions of slides and the animation helps out with the words appearing on the screen in a more creative way. Therefore, C and D are out. The slide layout is the part where if you click on it, slide designs are shown for you to choose from. The shapes can be used for design, but it doesn't help if you're looking for the design of a slide. The answer is A: slide layout.
5 0
2 years ago
Question 1 (True/False Worth 15 points)
liraira [26]

It is a programmer's responsibility to contribute to society and human well-being is true.

Explanation:

  • It is a programmer's responsibility to contribute to society and human well-being is true.
  • The Association for Computing Machinery (ACM) is known as  the world's largest educational and scientific computing society.
  • It has its own Code of Ethics and another set of ethical principles which were also approved by the IEEE as the known standards of teaching and practicing software engineering.
  • Programmers contribute to develop computer systems which can reduce negative impression to the society.
  • The negativity includes as threats to safety and health, which can be reduced and make everyday activities and work easier.
  • software developers should reduce the risk of harming others due to the coding errors or the security issues which could impact human well-being.

3 0
2 years ago
CS160 Computer Science I In class Lab 10
lianna [129]

Answer:

The program in Python is as follows:

fname = input("Enter the translation file name: ")

with open(fname) as file_in:

   lines = []

   for line in file_in:

       lines.append(line.rstrip('\n'))

myDict = {}

for i in range(len(lines)):

x = lines[i].split(":")

myDict[x[0].lower()] = x[1].lower()

print("Enter an English word to receive the Spanish translation.\nPress ENTER to quit.")

word = input("Enter an English word: ")

while(True):

if not word:

 break

if word.lower() in myDict:

 print("The Spanish word is ",myDict[word.lower()])

else:  

 print("I don’t have that word in my list.")

word = input("Enter an English word: ")

Explanation:

This prompts the user for file name

fname = input("Enter the translation file name: ")

This opens the file for read operation

with open(fname) as file_in:

This creates an empty list

   lines = []

This reads through the lines of the file

   for line in file_in:

This appends each line as an element of the list

       lines.append(line.rstrip('\n'))

This creates an empty dictionaty

myDict = {}

This iterates through the list

for i in range(len(lines)):

This splits each list element by :

x = lines[i].split(":")

This populates the dictionary with the list elements

myDict[x[0].lower()] = x[1].lower()

This prints an instruction on how to use the program

print("Enter an English word to receive the Spanish translation.\nPress ENTER to quit.")

This prompts the user for an English word

word = input("Enter an English word: ")

This loop is repeated until the user presses the ENTER key

while(True):

If user presses the ENTER key

if not word:

The loop is exited

 break

If otherwise, this checks if the word exists in the dictionary

if word.lower() in myDict:

If yes, this prints the Spanish translation

 print("The Spanish word is ",myDict[word.lower()])

If otherwise,

else:

Print word does not exist

 print("I don’t have that word in my list.")

Prompt the user for another word

word = input("Enter an English word: ")

5 0
2 years ago
Other questions:
  • Discuss 2D gameplay and how new platforms such as cell phones are taking advantages of this renewed market
    5·1 answer
  • If parties in a contract are not ____, the contract can be canceled.
    12·1 answer
  • Which of these is a social consequence of effective communication
    12·1 answer
  • which of the following is a malicious program that can replicate and spread from computer to computer? A. Email B. Virus C. Spam
    15·1 answer
  • I WILL GIVE BRAINLIEST TO WHO ANSWERS FIRST AND CORRECTLY.
    12·1 answer
  • Explain 3 categories of plagiarism​
    14·2 answers
  • What is the orbit? Define
    12·1 answer
  • Nathaniel wanted to buy a microphone. He went to an electronics store and was told that there are actually two types of micropho
    13·2 answers
  • Help plz
    10·1 answer
  • . Write at least three benefits of using a network.​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!