Multiply two numbers

EasyBasic Programs · 3 of 40

Write a Python program to multiply two numbers.

Advertisement
Input
a = 12, b = 7.5
Output
Product: 90.0

Approach

  1. Multiply the numbers with *.
  2. Print the product.

Solution

Python
a = 12b = 7.5 product = a * bprint("Product:", product)
Output
Product: 90.0

Line by line

Lines 1-2

One value is an int and the other a float.

Line 4

Multiplying an int by a float gives a float, so the result prints as 90.0.

Advertisement

Learn the concept

New to this topic? Read the lesson, then come back.

More basic programs

← All 40 Basic Programs