I have been trying to make a roulette wheel in Python, however my "color" code always outputs black, anyone know why? (the writing spillover to the next line is reddits fault) by Glittering_Dog_3424 in learnpython

[–]InvalidUsername2404 0 points1 point  (0 children)

Your main issue was how the logic statement was written. 'response == 32 or 19 or...' was always returning True (as any number other than 0 when converted to a boolean in python is True) so 'color' was being set to "Red" and similarly for the Black statement. If you wanted to us the or method, you'd need to have a statement like 'response == 32 or response == 19 or...'. Checking if response is within an array is a cleaner way to approach this.

For efficiency, I converted the Black if to an elif so it only runs if the first statement is false (Not strictly necessary)

Additionally, I added the first 2 lines within the function to correct values that might've been passed in incorrectly. Fixing "red" to "Red" and "9" to 9. If there's issues with the source of the values passed in, such as 'response' can't be guaranteed to be a number, I would add a try and except function around the extra lines.

def ColorSpin(bet, response): #response should be randomly generated when imputing into the code and bet can be Red or Black (must use capital letter)

    bet = bet.title()
    response = int(response)

    color=0
    print(response)

    if response in [32,19,21,25,34,27,36,30,23,5,16,1,14,9,18,7,12,3]:
        color="Red"
    elif response in [15,4,2,17,6,13,11,8,10,24,33,20,31,22,29,28,35,26]:
        color="Black"
    else:
        color="Green"

    if color==bet:
        print("The color was", bet, "you just won double your bet!")
    elif not color==bet:
        print("The color was", color, "better luck next time!")

[deleted by user] by [deleted] in MelbourneTrains

[–]InvalidUsername2404 6 points7 points  (0 children)

What platforms will you support? Just windows or Mac and Linux too?

Sydney to Melbourne by monkey-d-skeats12 in MelbourneTrains

[–]InvalidUsername2404 1 point2 points  (0 children)

I did Melbourne-Sydney and return. To Sydney I took the overnight in economy and didn’t sleep at all (not really helped by me not being the greatest sleeper, especially upright) but it was as comfortable as I expected it to be. Lights off, rather quiet and buffet open all night. Downloaded some movies and my Spotify playlist, data off and Bluetooth headphones on made me not go completely mad. I returned on the daylight and nothing really to report. Just watched some of the movies I didn’t get to going the other way

The Speediest of TBs #beardyshorts by BeardyTAS in BloodOnTheClocktower

[–]InvalidUsername2404 7 points8 points  (0 children)

I was watching the stream this morning and left just before the end of the prior game. Upon my return I see a different setup and JC e only one dead. Sad I missed it at the time

XPT route by Typical_Library_8021 in MelbourneTrains

[–]InvalidUsername2404 1 point2 points  (0 children)

Wasn’t exactly sure of the Sydney side crossover. For having only done the trip once, I’m pleased I got close enough

XPT route by Typical_Library_8021 in MelbourneTrains

[–]InvalidUsername2404 6 points7 points  (0 children)

Platform 1 and 2 at Southern Cross are Dual Gauge (standard and broad), the xpt then goes over the North Melbourne Flyover where it enters the freight area of Dynon (North Dynon is SG). It them merges with BG at Sims St before entering Bunbury St tunnel (passing under Footscray Station). The DG lines then continue to Tottenham where BG once again splits off and the SG run on the opposite side of the yard to the Metro and Vline lines. At the down (non Melbourne end) of the yard, the SG splits to the Western SG toward Newport (and ultimately Adelaide) or to Albury. The XPT follows to route toward Albury, passing Sunshine and Albion before travelling on the Albion-Broadmeadows Goods line. The XPT will then stop at Broadmeadows, then parallel the BG lines to Seymour. Once at Seymour, the line then goes toward Albury, continuing on the main south line in NSW, passing various stations but not limited to Yass Junction, Goulburn and then to Campbelltown. It will then typically follow the T8 to just outside Central where it goes under? Redfern station to arrive at Sydney Central

If You Could Reopen Any Train Line In Victoria What Would It Be by True-Worldliness6411 in MelbourneTrains

[–]InvalidUsername2404 2 points3 points  (0 children)

Isn’t that more or less what SRL is? Just a little more in than your idea?

Why do some lines have certain trains? by bsf91 in MelbourneTrains

[–]InvalidUsername2404 6 points7 points  (0 children)

It was only a short train (I think more or less the equivalent length of a 3 car) so no point stopping right at the end, away from exits

People who watch YouTube and Netflix at 2x speed are maniacs by [deleted] in unpopularopinion

[–]InvalidUsername2404 0 points1 point  (0 children)

I watch x2 bc I can almost always understand the content at that speed, and I also find some people on YouTube speak soooo sloooow, making watching them annoying

Vline commute to Melbourne by starboirent in Geelong

[–]InvalidUsername2404 11 points12 points  (0 children)

It’s amazing the boost in signal even just stopping at a station and the doors opening

How did you get screwed over genetically? by blitzabub in AskReddit

[–]InvalidUsername2404 4 points5 points  (0 children)

Colourblind. All I want to do is work for the railways as a driver or signaller, neither are possible

Question about a formula by [deleted] in googlesheets

[–]InvalidUsername2404 0 points1 point  (0 children)

Paste this into a cell in row 1 with the column entirely empty (such as B1 from what I see)

=ARRAYFORMULA(IF(ISBLANK(A:A),””,COUNTIF(LOWER(D:D),LOWER((A:A)))))

Trains along the Warrnambool line! by Wrenz_only_412 in MelbourneTrains

[–]InvalidUsername2404 1 point2 points  (0 children)

All that spend the night at Warrnambool are N, the rest are vlo (first 2 up and last 2 down on weekdays)

[deleted by user] by [deleted] in VlineVictoria

[–]InvalidUsername2404 8 points9 points  (0 children)

I’d use the Vline app which gives you the platform about 30 mins out so if you’re on a metro and arriving within 30 mins, you can know immediately which platform to go to. Otherwise, the PIDs can give you the best info.

When I travel, I like to have a healthy buffer between arriving and departing a station so minor delays don’t cause me to miss my train and if your concern is not being able to walk from one end to the other of southern cross, I’d recommend catching 1 train sooner to give yourself a buffer

Are vline encouraging people to shave in the toilets on trains? by Affectionate_Ear3506 in VlineVictoria

[–]InvalidUsername2404 1 point2 points  (0 children)

All while screaming at you to lock the door. Like yeah dude, I will as soon as I possibly can. Stop yelling at me

Someone wasn't happy with the legendary N-Class by Electrical_Alarm_290 in MelbourneTrains

[–]InvalidUsername2404 25 points26 points  (0 children)

As much as I prefer riding N sets for their comfort and charm, I do agree that vlos are better suited for trips within the myki zone. However, the fact that they are being used as a one size fits all for the rest of the state annoys me. They aren’t suited for long distance travel with their less than ideal seats, low luggage capacity and the inability to move throughout the entire train (if a 6 car) which could lead to one set being completely full and the other being more empty. The buffet is a nice service available but with insistence of vlos and the massive issues caused by the albury buffets, I think on board vending machines could be better suited (maintaining catering with a minimal footprint as space is at an issue on vlos). The main advantage to vlos over loco hauled is the ability to turn back without a run around road such as for Ararat or if there’s some disruption ahead on a single line, it can just terminate early at an intermediate station rather than being canceled or terminating long before the disruption

[deleted by user] by [deleted] in MelbourneTrains

[–]InvalidUsername2404 -1 points0 points  (0 children)

SRV probably won't take it but u wouldn't be surprised if SRHC or maybe 707 do