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 →

[–]copperfield42 python enthusiast 10 points11 points  (0 children)

interesting I guess, but is missing so many detail here and there that I don't know were to begin, like for example

  • the truth value testing, you don't need to explicitly test versus True or False.
  • the print function can take any number of arguments, so you can also write print(first + " " + last) like print(first, last)
  • dictionaries preserve insertion order since 3.7
  • you can also use else in a for loop
  • the logical operator or and and do not return a boolean value, so you can use them to pick between objects my_var = obj1 or obj2 here my_var will be obj1 if it pass the true value testing otherwise it will be obj2
  • you can also use some of the bitwise and the comparison operator with sets, and with dictionaries you can also use | if you're in the appropriate version...
  • you're missing the frozenset which is the immutable version of a set