Question

Write a program (python) that multiplies two hard-coded numbers, then prints the individual numbers out and...

Write a program (python) that multiplies two hard-coded numbers, then prints the individual numbers out and prints their product out, all on separate lines. You can choose the two numbers that are multiplied together.

Make a copy of previous exercise then modify it to print output exactly like this, rather than just the numbers on separate lines:

10 x 7 = 70

Do this using the string.format() function discussed in the lecture.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

# Required python program
num1=int(input())
#to fix the value of num1,directly assign like num1=value
num2=int(input())
product=num1*num2
#string formating is used to print the output
print("{}*{} = {}".format(num1,num2,product))

Add a comment
Know the answer?
Add Answer to:
Write a program (python) that multiplies two hard-coded numbers, then prints the individual numbers out and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • On question 1-3 can you please answer each script separately. Please Use Perl Scripting 1. write...

    On question 1-3 can you please answer each script separately. Please Use Perl Scripting 1. write a program that computes the circumference of a circle with a radius of 12.5. Circumference is 2π times the radius (approximately 2 times 3.141592654). The answer you get should be about 78.5. 2. Modify the program from the previous exercise to prompt for and accept a radius from the person running the program So, if the user enters 12.5 for the radius, she should...

  • Multiplication of two numbers: Write a recursive program that multiplies two integers. As an input to...

    Multiplication of two numbers: Write a recursive program that multiplies two integers. As an input to your program perform multiplication of the largest 8-bit number (unsigned) with the largest 16-bit number (unsigned) [Programming, 10 Points]. Complete in python and show output

  • Python program using a “for” loop that iterates 10 times and prints the numbers (spelled out)...

    Python program using a “for” loop that iterates 10 times and prints the numbers (spelled out) as, ‘one’, ‘two’, ‘three’,…etc. each on its own line.

  • Please Use Python and provide explanations!!!! 1. Write a function called multiply_and_print that takes two numbers,...

    Please Use Python and provide explanations!!!! 1. Write a function called multiply_and_print that takes two numbers, multiplies them together, and prints out the sentence '____ times ____ is ____'. Ask the user for two numbers, and call multiply_and_print with their two numbers as arguments. 2.Write a function called roll_dice that rolls two six-sided dice and prints out the result of each die. Call it three times. (Remember, you can import the random module with the statement import random, and then...

  • write this python program 4. Pascal Triangle. Write a program pascal.py that builds and prints a...

    write this python program 4. Pascal Triangle. Write a program pascal.py that builds and prints a two-dimensional list (a list of lists) a such that a[n][k contains the coefficient of the k-th term in the binomial expansion of (ty) These coefficients can be organized in a triangle, famously known as Pascals triangle. Every row in the triangle may be computed from the previous row by adding adjacent pairs of values together. Below is a sample invocation of the program s...

  • Greeter Write a function that takes in a person's name, and prints out a greeting. The...

    Greeter Write a function that takes in a person's name, and prints out a greeting. The greeting must be at least three lines, and the person's name must be in each line. example: Hello name How are you do name Nice to meet you name Use your function to greet at least three different people. Full Names Write a function that takes in a first name and a last name, and prints out a nicely formatted full name, in a...

  • We want to create a program which prints off what letter grade an individual receives based...

    We want to create a program which prints off what letter grade an individual receives based upon whether or not their grade obeys the following condition: grade>= 90 and grade = 80 and grade<89, we will print off “You made a B”, so on and so forth. In this program, we can assume that we are asking the user to enter whatever grade they recieved as a numeric input. NEED HELP WITH ALL PARTS! 4.) Consider the example of grades...

  • Write a program that reads a list of integers in the range (0 – 49) and prints out the numbers that does not repeat twice

    IN PYTHONWrite a program that reads a list of integers in the range (0 – 49) and prints out the numbers that does not repeat twice.The first input of the program is the number of integers contained in this list, followed by the integers contained in the list. Print the numbers in in ascending order.Case 1:INPUT: 5 2 2 3 3 1OUTPUT:1Case 2:INPUT:6 1 2 1 2 2 2OUTPUT:2Case 3:INPUT:4 3 2 1 2OUTPUT: 1 3343 2 1 213

  • 1) Translate the following equation into a Python assignment statement 2) Write Python code that prints...

    1) Translate the following equation into a Python assignment statement 2) Write Python code that prints PLUS, MINUS, O ZERO, depending on the value stored in a variable named N. 3) What is printed by: 3 - 1 while 5: while 10 Print ) Page 1 of 9 4) Write a Python while loop that reads in integers until the user enters a negative number, then prints the sum of the numbers. 1-2 of 9 4) Write a Python while...

  • Homework - Topic 1 - Print 1 to 100: Write a program that prints the numbers...

    Homework - Topic 1 - Print 1 to 100: Write a program that prints the numbers from 1 to 100 with five values per line, two blank spaces between values. The last few lines will look like this: 91 92 93 94 95 96 97 98 99 100 using exclipse without it

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT