Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Program Problem
#3
(May-25-2019, 11:36 AM)ichabod801 Wrote: The input function returns a string. You are comparing a string to a number, which is always not equal. You need to convert the return value of input using the int() built-in. And really, you should be testing for equality (==) on line 12, not inequality (!=). So line 12 should be if int(answer) == total:.

Thank you so much! And the ''!='' in line 12 I forgot to change. I was only testing if that should work. But again, thanks!
Reply


Messages In This Thread
Program Problem - by ChrisG - May-25-2019, 11:21 AM
RE: Program Problem - by ichabod801 - May-25-2019, 11:36 AM
RE: Program Problem - by ChrisG - May-25-2019, 11:41 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem: Once I cancel the process my program will start working! Hadad 0 1,660 Jul-24-2019, 04:09 PM
Last Post: Hadad
  Program Problem (2) ChrisG 2 2,401 May-25-2019, 05:11 PM
Last Post: ChrisG
  problem running program in VScode LavaCreeperKing 4 3,900 Mar-25-2018, 04:34 PM
Last Post: LavaCreeperKing
  Program not running (Overloading problem) anurag123 2 2,579 Feb-19-2018, 07:23 PM
Last Post: nilamo
  Vending Machine Program: Problem with variables icabero0225 2 8,523 Jun-08-2017, 11:04 AM
Last Post: buran
  Whats my python program's problem arman 13 8,882 Mar-13-2017, 08:47 PM
Last Post: metulburr
  problem with importing my program meems 1 3,818 Nov-27-2016, 01:19 AM
Last Post: micseydel

Forum Jump:

User Panel Messages

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