Categories
Mastering Development

Converting a string to integers and assigning them to variables

Example I have line that is "3 2 11" . I want to split that into 3 so "3" , "2", "11" and the convert them into integers and assign them into individual variables my code so far below:

import sys
for line in sys.stdin:
    print(line, end="")

snailHasNotEscaped = True
days = 0
totalMs = 0

mPerWholeDay = N - M

while snailHasNotEscaped:
   totalMs += mPerWholeDay
   days += 1
   if totalMs >= H:
      snailHasNotEscaped = False

Leave a Reply

Your email address will not be published. Required fields are marked *