ValueError: invalid literal for int() with base 10: ''

前端 未结 18 1902
甜味超标
甜味超标 2020-11-22 02:06

I am creating a program that reads a file and if the first line of the file is not blank, it reads the next four lines. Calculations are performed on those lines and then t

18条回答
  •  逝去的感伤
    2020-11-22 03:02

    This could also happen when you have to map space separated integers to a list but you enter the integers line by line using the .input(). Like for example I was solving this problem on HackerRank Bon-Appetit, and the got the following error while compiling

    So instead of giving input to the program line by line try to map the space separated integers into a list using the map() method.

提交回复
热议问题