Results for “variables”

Showing 41–50 of 53

  1. Challenge

    Flag from config text

    …give and store the answers, True or False , in the two variables. Run them to check, and remove any lines you added before you check. Modify. Work dry_run out by comparing the text with "True" , so it…

    Fix the code Easy 3 stages bool if else config
  2. Article Python Fundamentals

    Python If/Else for Beginners

    …Overly complex conditions: Break them into named boolean variables for clarity. safe_fuel = fuel >= 60 good_weather = wind_speed < 20 if safe_fuel and good_weather: launch = True Relying on…

  3. Article Python Fundamentals

    Python Books for Beginners

    …book's structure: first half covers Python fundamentals (variables, lists, dictionaries, functions, classes), while the second half walks you through three complete projects - a Space Invaders-style…

  4. Article Python Fundamentals

    Python print() Function

    …temperature:", telescope_temp, "Kelvin") The variable telescope_temp is set by us, but it could actually be set by the temperature monitoring system, and with print, you can display it on the screen…

  5. Article Mini projects

    Converting Temperatures in Python

    …enter: ")) We assign the choice entered by the user to the variable choice as a numerical value int. Performing calculations Having saved the choice in the choice variable, we can call the appropriate…

  6. Challenge

    Test the error

    …fuel_needed(-5) raises ValueError : call it in try , set a variable to True in except ValueError: , and assert it after. Then print: All checks passed Leave the function as it is. The hidden tests…

    Write the code Medium 2 stages testing assert try except
  7. Challenge

    Extract a function

    …once and then pasted for the next two waypoints, with the variable names changed by hand. One wrong name in one copy and the display would lie about one waypoint only. Give the formula a name, call it…

    Fix the code Easy 2 stages functions refactoring return tuples