Results for “first program”

Showing 21–30 of 47

  1. Challenge

    Launch counter crash

    …and a function that adds one to it. On launch day, the first launch stopped the program with an error nobody had seen before. Predict what happens, find out why, then fix it in a way that keeps the…

    Fix the code Medium 3 stages functions scope UnboundLocalError global
  2. Challenge

    Assignment in a condition

    …Look closely at the if line and at the line under it. This program never runs, and a program that doesn't run can't be checked. After you run it and read the error, put a # in front of each of the…

    Fix the code Easy 3 stages if else == SyntaxError
  3. Challenge

    Mission Control online

    …that a monitoring system reads character by character. A first Python challenge on exact output with print(), right in your browser.

    Write the code Easy 2 stages print output strings beginner
  4. Challenge

    Never-ending wait

    …with the same line, over and over, until someone stops the program. Predict what it does, find out why it never ends, fix it, then write a wait that knows when to give up. Predict and run Don't run…

    Fix the code Easy 3 stages while loop infinite loop counter and
  5. Challenge

    Names that explain

    …module and called the variables a , b , x2 and tmp . The program works, but nobody, including its author a month from now, can tell what it calculates without working through every line. Predict what…

    Fix the code Easy 3 stages variable names refactoring readability clean code
  6. Challenge

    Real JSON

    …one. That was a shortcut. A real API sends text, and the first thing any program does with it is turn that text into data. Do that step yourself with the json module, then deal with a response that…

    Write the code Easy 2 stages json json.loads modules import
  7. Challenge

    Edge cases

    …for mean(): an ordinary list and a list with one value first, then the edge cases, an empty list that should give None and lists with negative values, so broken copies of the function can't pass.

    Write the code Medium 2 stages testing assert edge cases None