Quiz
Python *args and **kwargs Quiz
…and **kwargs: 15 questions on extra arguments, tuples, dictionaries, and * and ** in calls. Instant answers.
Showing 41–50 of 52
Quiz
…and **kwargs: 15 questions on extra arguments, tuples, dictionaries, and * and ** in calls. Instant answers.
Example
Operator ** allows accepting any number of keyword arguments.
Article Mini projects
…coding our space weight calculator: First, we'll create a dictionary of planets and their surface gravities: planets = { "Mercury": 3.7, "Venus": 8.87, "Earth": 9.81, "Mars": 3.711, "Jupiter": 24.79…
Quiz
…the earlier quizzes, from variables and strings to lists, dictionaries and functions. For each piece of code you decide which error it raises, read the message, or choose the fix. What the quiz covers…
Quiz
…. After this one, try the Python Tuples Quiz or the Python Dictionaries Quiz .
Quiz
…. After this one, try the Python Lists Quiz or the Python Dictionaries Quiz .
Article Python Fundamentals
…first half covers Python fundamentals (variables, lists, dictionaries, functions, classes), while the second half walks you through three complete projects - a Space Invaders-style game, data…
Article Python Fundamentals
…print(common_targets) Dictionaries Key-value pairs, perfect for storing related data: planet_data = { "name": "Mars", "diameter": 6779, # kilometers "has_moons": True, "moons": ["Phobos", "Deimos"] }…
Example
Sets store only unique elements without a specific order.
Example
When to use tuples instead of lists? Comparison of properties and applications.