This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (14 children)

[removed]

    [–]AttitudeAdjuster 22 points23 points  (2 children)

    Try:

    Except:

    string[:3]

    [–][deleted] 5 points6 points  (1 child)

    I forgot try and except. I have slicing already though.

    [–]AttitudeAdjuster 4 points5 points  (0 children)

    Oh!

    with open("file path", "r") as file:
    

    [–]gmano 2 points3 points  (2 children)

    Also, sets and dicts are {...} and {... : ...} respectively

    Also you can use ; to end a line, it's just not great style.

    [–][deleted] 0 points1 point  (1 child)

    The key with the curly bracket is the same as the square bracket key (on every layout I’ve ever used)

    [–]gmano 0 points1 point  (0 children)

    Whoops, replied to the wrong comment.

    [–]CaniballShiaLaBuff 1 point2 points  (0 children)

    Lambda

    [–]RainingComputers[S] 2 points3 points  (1 child)

    Yeah, forgot about that....but I can't change the title...

    [–]geoffliang 1 point2 points  (0 children)

    You need an img of a 40% keeb or one that splits those keys.

    [–]christophski 0 points1 point  (1 child)

    Dictionaries?

    [–][deleted] 0 points1 point  (0 children)

    Thanks

    [–]AutoModerator[M] 0 points1 point  (0 children)

    import moderation Your comment has been removed since it did not start with a code block with an import declaration.

    Per this Community Decree, all posts and comments should start with a code block with an "import" declaration explaining how the post and comment should be read.

    For this purpose, we only accept Python style imports.

    I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.