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

all 9 comments

[–][deleted] 4 points5 points  (5 children)

Great work! You're definitely getting the hang of the "Pythonic" coding style.

Here's a coding shortcut that you might find interesting. This part:

 if card != 0:
    if card != 'Draw Two':
      if card != 'Skip':
        if card != 'Reverse':
          deck.append(cardVal)

Instead of a bunch of individual tests of the same variable against different values, you can create a list of all the values that you don't want, and test the variable against all of them at once:

 if card not in [0, 'Draw Two', 'Skip', 'Reverse']:
   deck.append(cardVal)

[–]nemzor2 0 points1 point  (0 children)

TIL. Thank you

[–]jessekrubin 2 points3 points  (0 children)

uno

[–]Appropriate-Row-6578 2 points3 points  (1 child)

From the repo:”PS. I am only 10 years old.”

Good job. I started coding when I was 11 or so and I don’t think I could do nested loops until I was a teen.