python 9533

  1. What does the “yield” keyword do?
  2. What is a metaclass in Python?
  3. How do I check whether a file exists using Python?
  4. Does Python have a ternary conditional operator?
  5. What does if __name__ == “__main__”: do?
  6. Calling an external command in Python
  7. How to merge two dictionaries in a single expression?
  8. How to sort a dictionary by value?
  9. How can I create a directory if it does not exist?
  10. How do I list all files of a directory?
  11. Difference between append vs. extend list methods in Python
  12. Best way to check if a list is empty
  13. Does Python have a string 'contains' substring method?
  14. How to make a chain of function decorators?
  15. What is the difference between @staticmethod and @classmethod in Python?
  16. Using global variables in a function other than the one that created them
  17. Accessing the index in Python 'for' loops
  18. How do I install pip on Windows?
  19. Understanding Python's slice notation
  20. How do I pass a variable by reference?
  21. “Least Astonishment” and the Mutable Default Argument
  22. Finding the index of an item given a list containing it in Python
  23. Difference between __str__ and __repr__ in Python
  24. Check if a given key already exists in a dictionary
  25. How can I make a time delay in Python?
  26. Understanding Python super() with __init__() methods
  27. Iterating over dictionaries using 'for' loops
  28. Making a flat list out of list of lists in Python
  29. Catch multiple exceptions in one line (except block)
  30. Is there a way to run Python on Android?
  31. How can I make a time delay in Python?
  32. Add new keys to a dictionary?
  33. How to get current time in Python?
  34. Parse String to Float or Int
  35. How do I install pip on macOS or OS X?
  36. Hidden features of Python
  37. How to clone or copy a list?
  38. Is there a way to substring a string in Python?
  39. How to concatenate two lists in Python?
  40. How do you split a list into evenly sized chunks?
  41. Print in terminal with colors?
  42. Static class variables in Python
  43. How to get the number of elements in a list in Python?
  44. What does ** (double star/asterisk) and * (star/asterisk) do for parameters?
  45. Static methods in Python?
  46. Python join: why is it string.join(list) instead of list.join(string)?
  47. Upgrading all packages with pip
  48. Find current directory and file's directory
  49. Manually raising (throwing) an exception in Python
  50. How to convert string to lowercase in Python