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
Elanso [62]
3 years ago
12

Can anyone tell me what wrong with this code the instructions are "Currently, this program will add 6 and 3 together, output the

math problem and output the answer. Edit this code so that a random 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." My code runs but it hasa EOF. My code is
import random
random.seed(1,10)
a = random.randint (1,10)
b = random.randint (1,10)
print ("What is: " + str(a) + " X " + str(b) + "?")

ans = int(input("Your answer: "))

if (a * b == ans):
print ("Correct!")
else:
print ("Incorrect!")
Computers and Technology
1 answer:
atroni [7]3 years ago
4 0

Answer:

import random

a = random.randint(1,10)

b = random.randint(1,10)

answer = a * b

print(str(b)+" * "+str(a)+" = "+str(answer))

Explanation: So I am guessing you are on Edhesive Module 2.5 Intro to cs. Sorry it took so long but hopefully this works.

You might be interested in
Write a function called has_duplicates that takes a string parameter and returns True if the string has any repeated characters.
vichka [17]

Answer:

Explanation:

The python code for the question is attached in the image below.

The objective here is to write a code in python with a function called has_duplicates that takes a string parameter and returns True if the string has any repeated characters. Otherwise, it should return False.

SEE BELOW FOR THE CODE.

alphabet = "abcdefghijklmnopqrstuvwxyz"

test_dups = ["zzz","dog","bookkeeper","subdermatoglyphic","subdermatoglyphics"]

test_miss = ["zzz","subdermatoglyphic","the quick brown fox jumps over the lazy dog"]

def histogram(s):

   d = dict()

   for c in s:

       if c not in d:

           d[c]=1

       else:

           d[c] += 1

   return d

def has_duplicates():

   for string in test_dups:

       dictionary=histogram(string)

       duplicates=False

       for ch in dictionary.keys():

           if dictionary[ch] > 1:

               duplicates=True

               break

       if duplicates==True:

           print(string,"has duplicates")

       else:

           print(string,"has no duplicates")

def missing_letters(string):

   answer=""

   for ch in alphabet:

       if ch not in string:

           answer=answer+ch

   return answer

print("__________________________________________")

print(" Calling has_duplicates() function")

print("__________________________________________")

has_duplicates()

print("\n______________________________________________")

print("Calling missing_letters() function in for loop")

print("______________________________________________")

for i in test_miss:

   answer=missing_letters(i)

   if len(answer)>=1:

       print(i,"is missing letters",answer)

   else:

       print(i,"uses all the letters")

3 0
3 years ago
What video game has made the most money as of 2016?
Leona [35]
Overwatch has been considered the game
4 0
3 years ago
Read 2 more answers
Which aspects of a project do project makers oversee?
Phantasy [73]
Some people look over the extra details needed in the project.
3 0
3 years ago
Read 2 more answers
In this problem we consider sending real-time voice from Host A to Host B over a packet-switched network (VoIP). Host A converts
Minchanka [31]

Answer:

<u>The total time elapsed from the time a bit is created (from the original analog signal at Host A) until the bit is decoded (as part of the analog signal at Host B is </u><u>25.11 ms</u>

Explanation:

Host A first converts the analog signal to a digital 64kbps stream and then groups it into 56-byte packets. The time taken for this can be calculated as:

time taken 1= \frac{Packet Size in Bits}{Bit Rate}

                 = (56 x 8) bits / 64 x 10³ bits/s

                 = 7 x 10⁻³s

time taken 1= 7 ms

The transmission rate of the packet from Host A to Host B is 4 Mbps. The time taken to transfer the packets can be calculated as:

time taken 2= (56 x 8) bits / 4 x 10⁶ bits/s

                    = 1.12 x 10⁻⁴ s

time taken 2= 112 μs

The propagation delay is 18 ms.

To calculate the total time elapsed, we need to add up all the time taken at each individual stage.

<u />Time_{total}<u> = Time taken 1 + Time taken 2 + Propagation Delay</u>

                 = 7 ms + 112 μs + 18 ms

                 = 0.025112 s

Time_{total} = 25.11 ms

5 0
3 years ago
Name at least TWO kinds of gaming experiences that are possible with these new control devices but were not possible on original
Pie

Yes the ansewer is c bc you can look it up!


6 0
3 years ago
Other questions:
  • Software license infringement is also often called software __________.
    11·2 answers
  • When planning a presentation, there are several factors you need to consider. Which of the following is one factor you should co
    8·1 answer
  • Write a program that simulates flipping a coin to make decisions. The input is how many decisions are needed, and the output is
    14·1 answer
  • Who plays Rblx?? What do yall play?
    9·2 answers
  • You are asked to write a program that prompts the user for the size of two integer arrays, user input for the size must not exce
    13·1 answer
  • What blockchain implementation resulted from bitcoin’s rejection of a recommendation to enhance its scripting language support?
    9·1 answer
  • Describe how you will lunch a web browser using the start menu​
    6·2 answers
  • Can someone write this in java? Also, does anyone know how to do Edhesive assignments?
    15·1 answer
  • ...............is a personal computer that fits on desk.​
    5·2 answers
  • What is the simplest form of backing up data?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!