Python Forum
ValueError: invalid literal for int() with base 10: ''
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ValueError: invalid literal for int() with base 10: ''
#1
Hello everyone, here again..

i am getting a problem with a part of my coding
numero = int(input('informe o pedido\n:'))
pedido = open(f'Pedidos_test\{numero}.txt', 'r')
teste = []
testa = []
cont = 0
indic_pedido = 0
for linha in pedido:
    linha = linha.rstrip()
    novo = int(linha)
    print(novo)
its giving me the error:
Traceback (most recent call last):
File "C:/Users/ivinj/PycharmProjects/mundo3/estresseeeeee.py", line 9, in <module>
novo = int(linha)
ValueError: invalid literal for int() with base 10: ''




I really don't know what it might be..

please help mee Sad
Reply


Messages In This Thread
ValueError: invalid literal for int() with base 10: '' - by ivinjjunior - Apr-20-2019, 12:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  ValueError: invalid literal for int() with base 10: omega_elite 5 11,243 Dec-30-2020, 06:11 AM
Last Post: delonbest
  invalid literal for int() with base 10: '# NRECS: 1096\n' Baloch 8 6,169 May-24-2020, 02:08 AM
Last Post: Larz60+
  invalid literal for int() with base 10: '' mrsenorchuck 5 12,391 Apr-29-2020, 05:48 AM
Last Post: markfilan
  ValueError: invalid literal for int() with base 10: '\n' srisrinu 9 7,962 Apr-13-2020, 01:30 PM
Last Post: ibreeden
  zlib decompress error: invalid code lengths set / invalid block type DreamingInsanity 0 9,236 Mar-29-2020, 12:44 PM
Last Post: DreamingInsanity
  input-ValueError: invalid literal for int() jacklee26 2 3,218 Feb-21-2020, 01:27 PM
Last Post: ndc85430
  ValueError: invalid literal for int() with base 10: '0.5' emmapaw24 2 4,723 Feb-16-2020, 07:24 PM
Last Post: emmapaw24
  ValueError: invalid literal for int() with base 10: '' Jay123 7 10,704 Aug-05-2019, 02:43 PM
Last Post: Jay123
  ValueError: invalid rectstyle object fen1c5 1 6,948 Jun-05-2019, 02:51 PM
Last Post: heiner55
  Problem with "invalid literal for int() with base 10: '' jirkaj4 4 11,470 Jan-23-2018, 06:55 PM
Last Post: jirkaj4

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020