Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error?
#8
(Jul-03-2018, 06:01 AM)buran Wrote: We were told to use eval() since int() and float() do not iterate.
I'm not sure what you mean by int() and float() do not iterate

I miss spoke by saying iterate, what I meant to say that having a user input numbers, like in the program the person was trying to do here, doing it with by saying something like a,b = int(input('Enter A and B: ")) will produce this error.

Error:
Traceback (most recent call last): File "C:\Users\bagpi\Desktop\test.py", line 1, in <module> a,b = int(input("Enter A and B: ")) ValueError: invalid literal for int() with base 10: '1,2'
Reply


Messages In This Thread
Error? - by juliabrushett - Jul-02-2018, 03:07 AM
RE: Error? - by Zombie_Programming - Jul-02-2018, 03:51 AM
RE: Error? - by gruntfutuk - Jul-02-2018, 11:43 AM
RE: Error? - by Zombie_Programming - Jul-03-2018, 02:49 AM
RE: Error? - by buran - Jul-03-2018, 04:14 AM
RE: Error? - by Zombie_Programming - Jul-03-2018, 05:43 AM
RE: Error? - by buran - Jul-03-2018, 06:01 AM
RE: Error? - by Zombie_Programming - Jul-03-2018, 06:18 AM
RE: Error? - by gruntfutuk - Jul-03-2018, 11:22 AM
RE: Error? - by buran - Jul-03-2018, 06:23 AM

Forum Jump:

User Panel Messages

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