Results for “count”

Showing 41–50 of 76

  1. Article Python Fundamentals

    Python Functions for Beginners

    …function that rejects negative numbers and asks again. 2. Countdown Write countdown(start) that prints the numbers from start down to 1, followed by "Liftoff!". Then add a second parameter for that…

  2. Challenge

    First error

    …one Find the first ERROR entry, print its line number, counting from 1, with the entry itself, and stop searching there: First error on line 4: [T+00:14:47] ERROR Fuel valve 2 not responding Loop with…

    Write the code Easy 2 stages for loop break enumerate flags
  3. Challenge

    Off-by-one slice

    …you'll see your prediction next to what Python printed. Count the positions in CG-0042 carefully before you guess. Investigate and modify Investigate. Store the index of the dash in dash_index and the…

    Fix the code Easy 3 stages strings slicing indexing off-by-one
  4. Challenge

    Log to a file

    …new entry with it, then read the file back, print it, and count its lines: [T+00:10:00] INFO Orbit insertion complete [T+00:12:05] WARN Battery 3 temperature high [T+00:14:47] ERROR Fuel valve 2 not…

    Write the code Easy 2 stages files open with write