Results for “variable”

Showing 21–30 of 53

  1. Challenge

    Silent branch

    …returns None for Scrub because that branch sets a variable but never returns it. Predict the last line, find which statuses give None, make every path return, then write a function where every path…

    Fix the code Easy 3 stages functions return None branches
  2. Challenge

    Landing site

    …landing site as a (lat, lon) tuple, unpack it into two variables in one line and print both to four decimals, then show it the way maps do, with N, S, E and W.

    Write the code Easy 2 stages tuples unpacking formatting coordinates
  3. Challenge

    Unit mix-up

    …thousands. Investigate and modify Investigate. Find the variable that holds a distance in a different unit and store its name, as text, in odd_one_out . Then convert it: one mile is 1.609344 km. Store…

    Fix the code Easy 3 stages units conversion constants debugging
  4. Challenge

    What arrived?

    …each value to the type it should have, into the new variables named in the comments, then print each new value and its type: altitude_km: 408 <class 'int'> speed_kms: 7.66 <class 'float'> crew: 3…

    Write the code Easy 3 stages type() data types type conversion sensor data
  5. Article Python Fundamentals

    Python Functions for Beginners

    …greet_crew is the name. The rules are the same as for variable names: lowercase letters, words joined with underscores, no spaces, and it can't start with a number. The parentheses () are where inputs…