Stellar Study Cards

Python Flashcards (Anki Alternative) | Best Decks for Python Mastery

177 Total Cards in This Deck

Python Flashcards (Anki Alternative) | Best Decks for Python Mastery

Arrow keys or swipe to navigate cards

1 / 177 Total
Basics

What is a variable in Python?

2 / 177 Total
Basics

How do you create a list in Python?

3 / 177 Total
Basics

What is the difference between a list and a tuple in Python?

4 / 177 Total
Basics

How do you write a comment in Python?

5 / 177 Total
Basics

What is a dictionary in Python?

6 / 177 Total
Basics

How do you check the data type of a variable in Python?

7 / 177 Total
Basics

What are Python's logical operators?

8 / 177 Total
Basics

How can you convert a string to an integer in Python?

9 / 177 Total
Basics

What does the len() function do in Python?

10 / 177 Total
Basics

How do you handle exceptions in Python?

11 / 177 Total
Basics

What is the purpose of the pass statement in Python?

12 / 177 Total
Basics

How do you define a function in Python?

13 / 177 Total
Basics

What is a module in Python?

14 / 177 Total
Basics

How can you import a module in Python?

15 / 177 Total
Basics

What does the if __name__ == '__main__': do in Python?

16 / 177 Total
Python Data Types

What are the basic built-in data types in Python?

17 / 177 Total
Python Data Types

How do you declare a string in Python?

18 / 177 Total
Python Data Types

What is the difference between a list and a tuple in Python?

19 / 177 Total
Python Data Types

How can you convert a number to a string in Python?

20 / 177 Total
Python Data Types

What function do you use to check the data type of a variable in Python?

21 / 177 Total
Python Data Types

How can you create an empty dictionary in Python?

22 / 177 Total
Python Data Types

What is a set in Python and how does it differ from lists?

23 / 177 Total
Python Data Types

How do you define a boolean variable in Python?

24 / 177 Total
Python Data Types

What is the difference between '==' and 'is' operators in Python?

25 / 177 Total
Python Data Types

How can you add an element to a list in Python?

26 / 177 Total
Control Structures in Python

What is a control structure in Python?

27 / 177 Total
Control Structures in Python

How do you write an if statement in Python?

28 / 177 Total
Control Structures in Python

What is the purpose of an else statement in Python?

29 / 177 Total
Control Structures in Python

How does an elif clause work in Python?

30 / 177 Total
Control Structures in Python

Write a simple for loop in Python that prints numbers from 1 to 5.

31 / 177 Total
Control Structures in Python

What is the purpose of a while loop in Python?

32 / 177 Total
Control Structures in Python

Explain the difference between a for loop and a while loop in Python.

33 / 177 Total
Control Structures in Python

How can you exit a loop prematurely in Python?

34 / 177 Total
Control Structures in Python

What is the purpose of the continue statement in loops?

35 / 177 Total
Control Structures in Python

When would you use a nested loop in Python?

36 / 177 Total
Control Structures in Python

How do you implement a pass statement in a loop?

37 / 177 Total
Control Structures in Python

What does the else clause do in a loop in Python?

38 / 177 Total
Python Functions

What is a function in Python?

39 / 177 Total
Python Functions

How do you define a function in Python?

40 / 177 Total
Python Functions

What is the purpose of the return statement in a function?

41 / 177 Total
Python Functions

How can you pass arguments to a function?

42 / 177 Total
Python Functions

What are default arguments in Python functions?

43 / 177 Total
Python Functions

Explain the difference between positional and keyword arguments.

44 / 177 Total
Python Functions

What are variable-length arguments and how are they represented in Python?

45 / 177 Total
Python Functions

Describe the concept of recursion in Python functions.

46 / 177 Total
Python Functions

How do you document a function using docstrings?

47 / 177 Total
Python Functions

What is a lambda function?

48 / 177 Total
Python Functions

What is meant by a higher-order function in Python?

49 / 177 Total
Python Functions

How does Python handle function arguments with mutable and immutable data types?

50 / 177 Total
Python Functions

What is function overloading and does Python support it?

51 / 177 Total
Python Functions

Explain decorators in Python functions.

52 / 177 Total
Python Functions

What does the *args and **kwargs syntax do in a function definition?

53 / 177 Total
Python Functions

How do you create a generator function in Python?

54 / 177 Total
Python Functions

What is the purpose of the global keyword in a function?

55 / 177 Total
Python Functions

How can you achieve function memoization in Python?

56 / 177 Total
Python Modules and Libraries

What is the purpose of the NumPy library in Python?

57 / 177 Total
Python Modules and Libraries

How do you import the Pandas library in Python?

58 / 177 Total
Python Modules and Libraries

What is the primary use of the Matplotlib library?

59 / 177 Total
Python Modules and Libraries

Explain the use of the 'requests' library in Python.

60 / 177 Total
Python Modules and Libraries

What does the Python library 'BeautifulSoup' do?

61 / 177 Total
Python Modules and Libraries

Describe the 'random' module in Python and its main use.

62 / 177 Total
Python Modules and Libraries

What is the primary goal of the 'datetime' module in Python?

63 / 177 Total
Python Modules and Libraries

How do you install external libraries in Python?

64 / 177 Total
Python Modules and Libraries

What is the 'sys' module used for in Python?

65 / 177 Total
Python Modules and Libraries

What is the difference between 'os' and 'os.path' modules?

66 / 177 Total
Object-Oriented Programming

What is object-oriented programming?

67 / 177 Total
Object-Oriented Programming

What is a class in Python?

68 / 177 Total
Object-Oriented Programming

What is an object in Python?

69 / 177 Total
Object-Oriented Programming

Explain the concept of inheritance in OOP.

70 / 177 Total
Object-Oriented Programming

What is polymorphism in Python?

71 / 177 Total
Object-Oriented Programming

What is encapsulation in OOP?

72 / 177 Total
Object-Oriented Programming

What is a method in Python?

73 / 177 Total
Object-Oriented Programming

What is the purpose of the __init__ method in Python?

74 / 177 Total
Object-Oriented Programming

How do you access attributes of an object in Python?

75 / 177 Total
Object-Oriented Programming

What is a static method in Python?

76 / 177 Total
Object-Oriented Programming

Explain the concept of 'self' in Python methods.

77 / 177 Total
Object-Oriented Programming

What is the difference between a class method and a static method in Python?

78 / 177 Total
Object-Oriented Programming

What is multiple inheritance?

79 / 177 Total
Object-Oriented Programming

How do you define a class in Python?

80 / 177 Total
Object-Oriented Programming

What is an abstract class in Python?

81 / 177 Total
File Handling in Python

How do you open a file in Python for reading?

82 / 177 Total
File Handling in Python

What is the purpose of the 'with' statement in file handling?

83 / 177 Total
File Handling in Python

How can you write data to a file using Python?

84 / 177 Total
File Handling in Python

What is the difference between 'read', 'readline', and 'readlines' methods?

85 / 177 Total
File Handling in Python

How do you check if a file exists in Python?

86 / 177 Total
File Handling in Python

What is the mode used to open a file for binary reading?

87 / 177 Total
File Handling in Python

How can you handle exceptions when working with files?

88 / 177 Total
File Handling in Python

Explain the difference between 'w' and 'a' modes in file handling.

89 / 177 Total
Error Handling in Python

What keyword is used to catch exceptions in Python?

90 / 177 Total
Error Handling in Python

How do you ensure that certain code runs no matter what in a try-except block?

91 / 177 Total
Error Handling in Python

Can you handle multiple exceptions in a single try-except block?

92 / 177 Total
Error Handling in Python

How do you raise an exception in Python?

93 / 177 Total
Error Handling in Python

What is the purpose of the else block in exception handling?

94 / 177 Total
Error Handling in Python

How can custom exceptions be created in Python?

95 / 177 Total
Error Handling in Python

What is the syntax to catch all exceptions without specifying them?

96 / 177 Total
Advanced Topics

What is a decorator in Python and how is it used?

97 / 177 Total
Advanced Topics

How can you create a generator in Python?

98 / 177 Total
Advanced Topics

Explain the use of the 'yield' keyword in Python.

99 / 177 Total
Advanced Topics

What is a 'closure' in Python?

100 / 177 Total
Advanced Topics

How do you apply multiple decorators to a single function in Python?

101 / 177 Total
Advanced Topics

What is the purpose of the functools.wraps() decorator?

102 / 177 Total
Advanced Topics

Describe how generator expressions differ from list comprehensions in Python.

103 / 177 Total
Advanced Topics

What is the advantage of using generators over lists?

104 / 177 Total
Advanced Topics

How does the @staticmethod decorator differ from @classmethod in Python?

105 / 177 Total
Advanced Topics

What are context managers in Python and how can they be implemented?

106 / 177 Total
Data Structures and Algorithms

What is the time complexity of searching for an element in a balanced binary search tree?

107 / 177 Total
Data Structures and Algorithms

What is a hash table?

108 / 177 Total
Data Structures and Algorithms

What is the basic idea of a quicksort algorithm?

109 / 177 Total
Data Structures and Algorithms

How does a stack differ from a queue?

110 / 177 Total
Data Structures and Algorithms

What are the primary operations of a linked list?

111 / 177 Total
Data Structures and Algorithms

What is the main disadvantage of a linear search compared to a binary search?

112 / 177 Total
Data Structures and Algorithms

What is a priority queue?

113 / 177 Total
Data Structures and Algorithms

What is an AVL tree?

114 / 177 Total
Data Structures and Algorithms

Describe the merge operation in the merge sort algorithm.

115 / 177 Total
Data Structures and Algorithms

What is the space complexity of the merge sort algorithm?

116 / 177 Total
Data Structures and Algorithms

What is a graph's adjacency list representation?

117 / 177 Total
Data Structures and Algorithms

What distinguishes a directed graph from an undirected graph?

118 / 177 Total
Data Structures and Algorithms

What is dynamic programming in algorithms?

119 / 177 Total
Data Structures and Algorithms

What is the difference between breadth-first search (BFS) and depth-first search (DFS) in graph traversal?

120 / 177 Total
Data Structures and Algorithms

Explain what a minimum spanning tree is in a graph.

121 / 177 Total
Data Structures and Algorithms

What is the Big O notation used for?

122 / 177 Total
Data Structures and Algorithms

How does a heap data structure work?

123 / 177 Total
Data Structures and Algorithms

What is the purpose of a depth-first traversal in trees?

124 / 177 Total
Data Structures and Algorithms

What is a circular buffer?

125 / 177 Total
Data Structures and Algorithms

What is the main advantage of a doubly linked list over a singly linked list?

126 / 177 Total
Web Development with Flask/Django

What is Flask in Python web development?

127 / 177 Total
Web Development with Flask/Django

How do you set up a basic Flask application?

128 / 177 Total
Web Development with Flask/Django

What are Django models and how are they used?

129 / 177 Total
Web Development with Flask/Django

Explain the concept of 'routes' in Flask.

130 / 177 Total
Web Development with Flask/Django

What is a Django ORM, and why is it useful?

131 / 177 Total
Web Development with Flask/Django

How do you handle form data in Flask?

132 / 177 Total
Web Development with Flask/Django

What is Django's 'settings.py' used for?

133 / 177 Total
Web Development with Flask/Django

How can you create a virtual environment for a Flask project?

134 / 177 Total
Web Development with Flask/Django

Explain middleware in Django and its usage.

135 / 177 Total
Web Development with Flask/Django

What is a 'Flask Blueprint', and when should it be used?

136 / 177 Total
Web Development with Flask/Django

How to manage static files in Django?

137 / 177 Total
Web Development with Flask/Django

How can you define a URL pattern in Django?

138 / 177 Total
Testing and Debugging

What is the purpose of the Python unittest module?

139 / 177 Total
Testing and Debugging

How do you run a test case using the unittest framework?

140 / 177 Total
Testing and Debugging

What is a breakpoint in the context of debugging?

141 / 177 Total
Testing and Debugging

Which Python statement is used to handle exceptions in a code block?

142 / 177 Total
Testing and Debugging

Explain the PDB module in Python.

143 / 177 Total
Testing and Debugging

Describe how to test for expected exceptions using unittest.

144 / 177 Total
Testing and Debugging

What is the role of assertions in testing?

145 / 177 Total
Testing and Debugging

What command is used to start the Python debugger (PDB)?

146 / 177 Total
Best Practices and Code Quality

What is PEP 8 and why is it important in Python programming?

147 / 177 Total
Best Practices and Code Quality

How can you ensure that your Python code is error-free before execution?

148 / 177 Total
Best Practices and Code Quality

What is the significance of using meaningful variable names in Python?

149 / 177 Total
Best Practices and Code Quality

Explain the importance of function documentation in Python.

150 / 177 Total
Best Practices and Code Quality

What does code refactoring mean and how does it contribute to code quality?

151 / 177 Total
Best Practices and Code Quality

How do you handle exceptions in Python, and why is it a best practice?

152 / 177 Total
Best Practices and Code Quality

What role does version control play in maintaining code quality?

153 / 177 Total
NumPy and Pandas for Data Science

How do you create a NumPy array from a Python list?

154 / 177 Total
NumPy and Pandas for Data Science

What is the primary object of the Pandas library?

155 / 177 Total
NumPy and Pandas for Data Science

How do you access the first three rows of a DataFrame in Pandas?

156 / 177 Total
NumPy and Pandas for Data Science

Explain how you can add a new column to a Pandas DataFrame.

157 / 177 Total
NumPy and Pandas for Data Science

Describe how to perform element-wise multiplication of two NumPy arrays.

158 / 177 Total
NumPy and Pandas for Data Science

How do you compute the mean of all elements in a NumPy array?

159 / 177 Total
NumPy and Pandas for Data Science

What is the method to handle missing data in Pandas?

160 / 177 Total
NumPy and Pandas for Data Science

How can you concatenate two Pandas DataFrames vertically?

161 / 177 Total
NumPy and Pandas for Data Science

Describe how to filter rows in a Pandas DataFrame based on a condition.

162 / 177 Total
NumPy and Pandas for Data Science

What is the Pandas method for reading a CSV file into a DataFrame?

163 / 177 Total
NumPy and Pandas for Data Science

How do you save a Pandas DataFrame to a CSV file?

164 / 177 Total
NumPy and Pandas for Data Science

Explain how to transpose a DataFrame in Pandas.

165 / 177 Total
NumPy and Pandas for Data Science

How do you merge two Pandas DataFrames based on a common column?

166 / 177 Total
NumPy and Pandas for Data Science

How can you create a new DataFrame with a multi-index in Pandas?

167 / 177 Total
NumPy and Pandas for Data Science

What function is used to find the standard deviation of values in a NumPy array?

168 / 177 Total
Project-Based Learning and Applications

What is project-based learning in the context of programming?

169 / 177 Total
Project-Based Learning and Applications

Why is project-based learning beneficial for mastering Python?

170 / 177 Total
Project-Based Learning and Applications

How can you incorporate project-based learning for Python beginners?

171 / 177 Total
Project-Based Learning and Applications

Describe a simple Python project that involves using data structures.

172 / 177 Total
Project-Based Learning and Applications

What role does feedback play in project-based learning?

173 / 177 Total
Project-Based Learning and Applications

What is an example of a project that can teach file handling in Python?

174 / 177 Total
Project-Based Learning and Applications

How does collaboration enhance project-based learning in Python?

175 / 177 Total
Project-Based Learning and Applications

Outline a project that uses APIs to gather data in Python.

176 / 177 Total
Project-Based Learning and Applications

What is a beneficial project to learn about Python's libraries for data visualization?

177 / 177 Total
Project-Based Learning and Applications

How can Python projects be used to simulate real-world problems?