Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Type Error or Value Error?
#1
print(int("100.0"))
it is type error, how is it value error?
Reply
#2
Execute the statement and see what exception pops up.
Reply
#3
@deanhystad I saw that it says value error but I feel that for whatever value of the float, it will give the error and not just some of the values, so it should be type error?
Reply
#4
int(arg) accepts strings as an argument, so it is not going to be a type error, no matter what is contained in the string. int(list) is a type error because list is not a valid argument type.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Wrong type error rowan_bradley 6 1,143 Aug-07-2023, 10:44 AM
Last Post: rowan_bradley
  Type Error: Unsupported Operand jhancock 2 1,067 Jul-22-2023, 11:33 PM
Last Post: jhancock
  [ERROR] ParamValidationError: Parameter validation failed: Invalid type for parameter gdbengo 3 10,644 Dec-26-2022, 08:48 AM
Last Post: ibreeden
  Python Anytree - Is not of type 'NodeMixin' error georgebijum 3 2,026 May-05-2022, 01:43 PM
Last Post: Gribouillis
  Incorrect Type Error milkycow 4 2,828 Jun-25-2021, 06:04 AM
Last Post: milkycow
  pandas.errors.ParserError: Error tokenizing data. C error: Expected 9 fields in line Anldra12 9 15,081 Jun-15-2021, 08:16 AM
Last Post: Anldra12
Star Type Error: 'in' object is not callable nman52 3 3,328 May-01-2021, 11:03 PM
Last Post: nman52
  Error : "can't multiply sequence by non-int of type 'float' " Ala 3 3,023 Apr-13-2021, 10:33 AM
Last Post: deanhystad
  Type Error in Python MarcusB 3 2,527 Mar-30-2021, 06:34 PM
Last Post: buran
  unsupported operand type(s) for /: 'str' and 'int' Error for boxplot soft 1 3,022 Feb-09-2021, 05:40 PM
Last Post: soft

Forum Jump:

User Panel Messages

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