1 Replies - 173 Views - Last Post: 16 February 2019 - 11:17 AM Rate Topic: -----

#1 faithers12   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 16-February 19

What is wrong with my code?

Posted 16 February 2019 - 11:09 AM

it says I get ValueError: could not convert string to float: 'NumberOfTickets.

Attached image(s)

  • Attached Image

Is This A Good Question/Topic? 0
  • +

Replies To: What is wrong with my code?

#2 xclite   User is offline

  • I wrote you an code
  • member icon


Reputation: 1364
  • View blog
  • Posts: 4,187
  • Joined: 12-May 09

Re: What is wrong with my code?

Posted 16 February 2019 - 11:17 AM

float converts its argument (in this case, "NumberOfTickets."). It is literally trying to convert the text "NumberOfTickets." to a floating point number. Try removing the quotes, i.e. float(NumberOfTickets) - note that this way, you're sending your variable NumberOfTickets instead of a string.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1