fork download
  1. NumGiven = ''
  2. while not NumGiven.isnumeric():
  3. NumGiven = (input('Please enter a 7 or 8 digit number:'))
  4. while len(NumGiven) < 7 or len(NumGiven) > 8:
  5. NumGiven = (input('Please enter a 7 or 8 digit number:'))
  6.  
  7. if len(NumGiven) == 8:
  8. my_list = [int(i) for i in NumGiven]
  9. temp = sum([int(i) for i in NumGiven])
  10. ans = temp / 10.0
  11.  
  12. if temp % 10 == 0:
  13. print("int")
  14. else:
  15. print("float")
  16.  
Success #stdin #stdout 0.03s 9984KB
stdin
55555555
stdout
Please enter a 7 or 8 digit number:int