Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Problem with an IF statement
Post: RE: Problem with an IF statement

(Jan-30-2020, 02:30 PM)buran Wrote: exactly (Jan-30-2020, 02:26 PM)Ryan_Todd Wrote: I also need to somehow keep track of the games won as it tends to always just say "1" instead of accumulating it...
Ryan_Todd General Coding Help 13 5,024 Jan-30-2020, 02:38 PM
    Thread: Problem with an IF statement
Post: RE: Problem with an IF statement

(Jan-30-2020, 02:16 PM)buran Wrote: How do you assign the value returned from input when you don't know what it will be? I can write the code, but it will be more beneficial for you if you get it do...
Ryan_Todd General Coding Help 13 5,024 Jan-30-2020, 02:26 PM
    Thread: Problem with an IF statement
Post: RE: Problem with an IF statement

(Jan-30-2020, 01:34 PM)buran Wrote: (Jan-30-2020, 01:16 PM)Ryan_Todd Wrote: I have now changed the value of the coin to match either heads or tails.no, you still compare coin (i.e. tuple) with use...
Ryan_Todd General Coding Help 13 5,024 Jan-30-2020, 02:07 PM
    Thread: Problem with an IF statement
Post: RE: Problem with an IF statement

(Jan-30-2020, 12:08 PM)buran Wrote: you have a try without except- just remove it Doh! Makes sense mport random coin = ('heads','tails') game = 0 while True: user_choice = input("Heads or ...
Ryan_Todd General Coding Help 13 5,024 Jan-30-2020, 01:16 PM
    Thread: Problem with an IF statement
Post: RE: Problem with an IF statement

(Jan-30-2020, 11:17 AM)buran Wrote: Note that you can simplify the user_choice verification if user_choice in coins: # assuming you applied lower() on input function print(f'you selected {user_c...
Ryan_Todd General Coding Help 13 5,024 Jan-30-2020, 12:00 PM
    Thread: Problem with an IF statement
Post: RE: Problem with an IF statement

(Jan-30-2020, 11:03 AM)buran Wrote: there are number of problems in your logic. so, first - your question on line 21 you compare coin, i.e. a tuple with 2 elements with a string. They never be equal...
Ryan_Todd General Coding Help 13 5,024 Jan-30-2020, 11:08 AM
    Thread: Problem with an IF statement
Post: Problem with an IF statement

Hi Guys, Still fairly new here, wondering why this loop is not working.. im trying to create a simple coin flip game. I know there is plenty of resource online for this and so many simple ways of doi...
Ryan_Todd General Coding Help 13 5,024 Jan-30-2020, 10:42 AM
    Thread: Problem with accepting multiple string inputs
Post: Problem with accepting multiple string inputs

Hello guys, Please see the below my_name = input("What is your name? ") my_secondname = input("What is your second name? ") age = int(input("What is your age? ")) measurement = input("What unit of m...
Ryan_Todd General Coding Help 5 2,956 Jan-22-2020, 04:54 PM

User Panel Messages

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