Example
Tuples vs Lists - Differences
When to use tuples instead of lists? Comparison of properties and applications.
Showing 41–50 of 62
Example
When to use tuples instead of lists? Comparison of properties and applications.
Example
Adding and removing elements from a set. Basic set operations.
Example
Dictionaries can contain other dictionaries. Useful for complex data structures.
Article Mini projects
…a Dictionary? In Python, a dictionary is a collection of key-value pairs. It's like a real-world dictionary where you have a word (the key) and its definition (the value). In our program, we use a…
Article Python Fundamentals
…are different variables) Cannot use Python's reserved keywords Reserved Keywords in Python Python reserves certain words for its own use. You cannot use these as variable names: # Common reserved…
Article Python Fundamentals
…way of knowing which slot a single argument was meant for. Keyword arguments Remember the swapped "Mars" and 4? Keyword arguments solve that. Instead of relying on position, you name the parameter…
Challenge
…line: GRAVITY_M_S2.get(body) gives None for a missing key, just like the old else . The whole table The table can do what the chain couldn't. After the line for the chosen body, print the astronaut's…
Quiz
…Mutable and immutable types, and what can be a dictionary key How it works 15 questions: 11 with one correct answer, 4 where you select every correct answer After each question you see the correct…
Article Python Fundamentals
…The newline character "\n" is like pressing the "Enter" key in your message. Let's look at a simple example: print("Mission Control Status:\nAll systems ready\nWeather is clear") This will display…
Article Python Fundamentals
…we need to set up our digital workspace. This involves two key steps: Installing Python Python is the interpreter that reads and executes our code. Here's how to get it: For Windows : Visit the…