Editor settings

General settings

Save settings

Learn to program with Python

Number division in Python #

In Python, number division can be performed using the forward slash / operator. When two numbers are divided, the result is always in type float.

For example:

a = 10
b = 5
print(a/b) # Output: 2.0

Exercise #

  • Change the value of 0 so that the value of x is 20
  • Must use the / sign
Output will be displayed here