Example
Creating Tuples
Tuples are immutable lists. Once created, they cannot be modified.
Showing 51–60 of 65
Example
Tuples are immutable lists. Once created, they cannot be modified.
Example
Python allows changing variable type during program execution. This is dynamic typing.
Example
Python recognizes different data types automatically. Learn int, float, str and bool.
Challenge
…2026-03-14T09:30:10Z,CABIN,ERR,kPa (could not convert string to float: 'ERR') 09:30:10 ENG-2: 415.0 C Skipped: 2026-03-14T09:30:15Z,ENG-2,4l7.9,C (could not convert string to float: '4l7.9') 09:30:15…
Challenge
…find it. A docstring Add a docstring to fuel_needed() : a string in triple quotes as the first line inside the function, saying what it returns and what the reserve means. The output doesn't change…
Article Python Fundamentals
…You can also describe a function with a docstring , a string in triple quotes placed right under the def line: def weight_on_planet(earth_weight, gravity=0.38): """Return what something would weigh on…
Challenge
…Someone passed confirm="yes" , and since a non-empty string is true, the abort ran. Accept only True itself, and add the call that tried: ABORT: Cabin pressure falling Abort refused: pass confirm=True…
Challenge
…its key in square brackets: launch["name"] . Inside an f-string, use single quotes for the key: {launch['name']} . Everything in the response Before relying on an API, developers look at a whole…
Challenge
…record["sensor"] , record["time"] and so on. Inside an f-string, use the other kind of quotes: {record['time']} .
Challenge
…kPa ENG-2: 415.0 C feed.splitlines() gives a list with one string per line. Inside the loop, line.split(",") gives the four fields, as in "Parse a telemetry line". Named fields and the time Unpack the…