Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: "if" beginner question
Post: RE: "if" beginner question

I think because a can't be (for example) 'milk' and 'MILK' so to fix that problem you can write: x="milk" y="sugar" z="tea" t="coffee"but ofcours the user can write it as Coffee or COFFEE so we have t...
Mr_W General Coding Help 13 6,248 Jan-13-2019, 01:01 PM
    Thread: Writing a code with 3 digit numbers while they cant contain 0 and then sum them
Post: RE: Writing a code with 3 digit numbers while they...

I tried your code with a = str(a) instead of just str(a) and it worked.
Mr_W General Coding Help 2 2,390 Jan-13-2019, 11:11 AM
    Thread: "if" beginner question
Post: RE: "if" beginner question

You should save the input in a variable. Now whatever you enter doesn't matter because your if statement is comparing x and z which are defined earlier. Not by the input. Check the link below. If that...
Mr_W General Coding Help 13 6,248 Jan-12-2019, 01:07 PM
    Thread: Python for Everybody 3.1 assignment
Post: RE: Python for Everybody 3.1 assignment

Yes sorry micseydel is right, I overread that part. rate should be an input as well The correct code is: hours = float(input("Enter hours: ")) rate = float(input("Enter rate per hour: ")) ratePlus = ...
Mr_W Homework 18 45,432 Jan-07-2019, 12:12 PM
    Thread: Python for Everybody 3.1 assignment
Post: RE: Python for Everybody 3.1 assignment

This should do the trick. Input 45 gives 498.75. hours = float(input("Enter hours: ")) rate = 10.5 ratePlus = 10.5 * 1.5 if hours > 40: pay = 40 * rate + (hours - 40) * ratePlus else: pa...
Mr_W Homework 18 45,432 Jan-06-2019, 06:24 PM
    Thread: Calculate and print the total cost
Post: RE: Calculate and print the total cost

By just giving you the code the learning aspect would be pretty much gone so the total code is in the spoiler. I'll give you some hints now so you can give it a try yourself first. Hints: -You have t...
Mr_W General Coding Help 7 11,639 Jan-01-2019, 02:17 PM

User Panel Messages

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