Python Integers and Floats are two different kinds of numerical data. An integer (more commonly called an int) is a number without a decimal point. A float is a floating-point number, which means it is a number that has a decimal place.

a. Creating an integer and a float: Integers and floats in Python can be created by assigning a number to a variable.## Code

## Output

b. Arithmetic operations: Python includes the following arithmetic operations - addition, subtraction, multiplication, division, floor division, modulus, and exponentiation.## Code

## Output

c. Comparison operations: Python includes the following comparison operations - equals, not equals, greater than, less than, greater than or equal to, less than or equal to.## Code

## Output

d. Converting between integer and float: Python includes the int() and float() functions to convert between integers and floats.## Code

## Output

## Enquiries

a. Creating an integer and a float: Integers and floats in Python can be created by assigning a number to a variable.

int1 = 10 float1 = 20.5 print(int1) print(float1)

10 20.5

b. Arithmetic operations: Python includes the following arithmetic operations - addition, subtraction, multiplication, division, floor division, modulus, and exponentiation.

x = 10 y = 3 print(x + y) print(x - y) print(x * y) print(x / y) print(x // y) print(x % y) print(x ** y)

13 7 30 3.3333333333333335 3 1 1000

c. Comparison operations: Python includes the following comparison operations - equals, not equals, greater than, less than, greater than or equal to, less than or equal to.

x = 10 y = 20 print(x == y) print(x != y) print(x > y) print(x < y) print(x >= y) print(x <= y)

False True False True False True

d. Converting between integer and float: Python includes the int() and float() functions to convert between integers and floats.

x = 10.5 y = 20 print(int(x)) print(float(y))

10 20.0

Copyright © 2023 - slash-root.com