4 Replies - 639 Views - Last Post: 20 June 2014 - 02:03 PM Rate Topic: -----

#1 amich97   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 20-June 14

i cant figure out the errors *new to python. -gross wage

Posted 20 June 2014 - 01:23 PM

strName = input("What is your name ?")
strLastname = input("What is your last name?")
strHours = input("How many hours do you work?") 
strWage = input("What is your hourly wage?")

fltHours =  float(strHours) 
fltWage = float(strWage)
pay = float(strwage) * float(strHours)
print = pay

This post has been edited by andrewsw: 20 June 2014 - 01:38 PM
Reason for edit:: Use code tags

Is This A Good Question/Topic? 0
  • +

Replies To: i cant figure out the errors *new to python. -gross wage

#2 andrewsw   User is offline

  • no more Mr Potato Head
  • member icon

Reputation: 6957
  • View blog
  • Posts: 28,696
  • Joined: 12-December 12

Re: i cant figure out the errors *new to python. -gross wage

Posted 20 June 2014 - 01:40 PM

What errors? Do you receive error messages? What happens when you run your code?

Anyway, identifiers are case-sensitive, so strwage is different to strWage.

But you should in future provide the details I mentioned.
Was This Post Helpful? 0
  • +
  • -

#3 amich97   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 20-June 14

Re: i cant figure out the errors *new to python. -gross wage

Posted 20 June 2014 - 01:45 PM

6 fltHours = float(strHours)
7 fltWage = float(strWage)
8 pay = float(strwage) * float(strHours)
9 print = pay

Edit code



<< First < Back Program terminated Forward > Last >>



ValueError: could not convert string to float # when I run it says that on line 6 - could not convert string to float
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw   User is offline

  • no more Mr Potato Head
  • member icon

Reputation: 6957
  • View blog
  • Posts: 28,696
  • Joined: 12-December 12

Re: i cant figure out the errors *new to python. -gross wage

Posted 20 June 2014 - 01:49 PM

It should also be print(pay) but other than these two changes the code works.

For your error on line 6 I can only assume that you didn't enter a number.

This post has been edited by andrewsw: 20 June 2014 - 01:51 PM

Was This Post Helpful? 0
  • +
  • -

#5 amich97   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 20-June 14

Re: i cant figure out the errors *new to python. -gross wage

Posted 20 June 2014 - 02:03 PM

View Postandrewsw, on 20 June 2014 - 01:49 PM, said:

It should also be print(pay) but other than these two changes the code works.

For your error on line 6 I can only assume that you didn't enter a number.

okay , thank you !
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1