-4

This is the code I am using but I keep getting a decimal number and I would like to get a whole number:

 total=0
      for i in empty:
          i=ord(i)
          total=total+i
      total=total/8
      print("this is you offset factor.....")

The numbers I keep on getting are numbers like this: 70.75 or 62.625

  • 1
    Please see [How to ask](http://stackoverflow.com/help/how-to-ask). A minimal amount of research, like searching for "python round", would have given you the answer. – Andrew Morton Jan 14 '16 at 09:34
  • 1
    Possible duplicate of [Python3 integer division](http://stackoverflow.com/questions/19507808/python3-integer-division) – Łukasz Jan 14 '16 at 09:35

1 Answers1

1

cast to int

>>> int(70.75)
70
>>> int(round(70.75, 0))
71
Praveen
  • 8,945
  • 4
  • 31
  • 49