Question: btw this has to be done in python 1. A happy number is found using the following process. Pick a number. Separate out its digits.

 btw this has to be done in python 1. A happy

btw this has to be done in python

1. A happy number is found using the following process. Pick a number. Separate out its digits. Square them. Add them together to form a new number. Repeat. If the eventual product is one, you've got a happy number. For example, consider the number 7. Is it happy? . SI: 72-49 . S2: 42+92-97 .Sq: 92 + 72 = 130 Sa: 12 +32 +02 =10 The number 7 becomes happy in 5 steps. Write a programa (ql.py) that asks for an integer number. If the number is happy, the program prints is Happy. Otherwise, it prints is Non-happy. Numbers that are happy follow a se quence that ends in 1. All non-happy numbers follow sequences that reach the cycle 4, 16, 37, 58, 89, 145, 42, 20, 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!