2 min read

In Division The number which we divide is called the dividend. The number by which we divide is called the divisor. The result obtained is called the quotient. The number left over is called the remainder.

Create a Python program to compute Quotient and reminder of two given numbers.

```
divisor = 5
dividend = 27
quotient = dividend//divisor
reminder = dividend % divisor
print("Quotient is", quotient)
print("Reminder is",reminder)
```

```
Quotient is 5
Reminder is 2
```

First, the numbers are saved in respective variables then to compute quotient we used the floor division `//`

operator that returns the integer value of the quotient and for the reminder, the modulus `%`

operator is used. Later we are just printing out the variables.

Create a Python program to compute Quotient and reminder of two user-provided numbers in real-time.

```
divisor = int(input("Enter the divisor"))
dividend = int(input("Enter the dividend"))
quotient = dividend//divisor
reminder = dividend % divisor
print("Quotient is {} and Reminder is {}".format(quotient, reminder))
```

```
Enter the divisor 5
Enter the dividend 27
Quotient is 5 and Reminder is 2
```

Here we are taking input from the user using the Python's built-in `input()`

method then we are converting it to an integer using the `int()`

method because `input()`

returns the objects as a string object.

Later we are performing the arithmetic operation and printing out the results using string formatting.

PROGRAMS

Latest from djangocentral

In Django, the request object contains a variety of information about the current HTTP request, including the query parameters. Query parameters are a way to pass additional information in the URL and are used to filter or sort data. The request object p…

Read more →

2 min read

In Django, related_name is an attribute that can be used to specify the name of the reverse relation from the related model back to the model that defines the relation. It is used to specify the name of the attribute that will be used to access the relat…

Read more →

2 min read