Advertisement
ALENTL

tp11 answer 2

Sep 14th, 2021
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. num = int(input('Enter the number: ',))
  2. n = num
  3. count = 0
  4.  
  5. while num > 0:
  6. num = num//10
  7. count = count + 1
  8.  
  9. print('No of digits: ',str(count))
  10.  
  11. if count%2 == 0:
  12. print('Print it is even')
  13. print('The square of the number is: ',n**2)
  14.  
  15. elif count%2 != 0:
  16. print('It is odd')
  17. print('The square root of the number is: ',n**0.5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement