Challenge
Assignment in a condition
An oxygen check uses = instead of == and has a line that isn't indented, so Python refuses to run it. Predict what happens, fix both errors one after the other, then write an if/else check yourself.
5 results
Challenge
An oxygen check uses = instead of == and has a line that isn't indented, so Python refuses to run it. Predict what happens, fix both errors one after the other, then write an if/else check yourself.
Example
Variables store data in your program. Learning to create and name variables in Python.
Quiz
…beginner quiz on Python variables: 15 questions on naming, assignment, data types, type conversion and scope, with instant answers.
Example
…can return multiple values as a tuple. Unpacking on assignment.
Article Python Fundamentals
…where it is not associated with a value Because there's an assignment to fuel inside the function, Python treats fuel as a local variable for that whole function. Then it finds you're trying to…