## Problem Statement:

In this Single Digit Number in Python problem, we are given a number, we need to add its digits, and we need to repeat this until the addition results in a single digit. At last, we need to print the result. For example, 78=> 7+8=>15=>1+5=>6.

## Code for Single Digit Number in Python:

```
import math
n = 78
while True:
if 1<=n<=9:
print(n)
break
else:
one = n%10
two = math.floor(n/10)
n = one + two
```

## Output:

## Explanation:

We imported the math module, declared n, and assigned 78 to it. Then inside it, we first check if n is between 1 and 9, we will print it else we will add it’s both digits. Our output results in **6** because 78=> 7+8=>15=>1+5=>6.

**Also Read:**

- Hyphenate Letters in Python
- Earthquake in Python | Easy Calculation
- Striped Rectangle in Python
- Perpendicular Words in Python
- Free shipping in Python | Assignment Expert
- Raj has ordered two electronic items Python | Assignment Expert
- Team Points in Python | Assignment Expert
- Ticket selling in Cricket Stadium using Python | Assignment Expert
- Split the sentence in Python | Assignment Expert
- String Slicing in JavaScript | Assignment Expert
- First and Last Digits in Python | Assignment Expert
- List Indexing in Python
- Date Format in Python | Assignment Expert
- New Year Countdown in Python | Assignment Expert
- Add Two Polynomials in Python | Assignment Expert
- Sum of even numbers in Python | Assignment Expert
- Evens and Odds in Python | Assignment Expert
- A Game of Letters in Python | Assignment Expert
- Sum of non-primes in Python | Assignment Expert
- Smallest Missing Number in Python | Assignment Expert
- String Rotation in Python
- Secret Message in Python | Assignment Expert
- Word Mix in Python | Assignment Expert
- Single Digit Number in Python
- Shift Numbers in Python | Assignment Expert
- Weekend in Python | Assignment Expert
- Shift Numbers in Python | Assignment Expert
- Temperature Conversion in Python | Assignment Expert
- Special Characters in Python | Assignment Expert
- Sum of Prime Numbers in the Input in Python