Challenge
Catch what you expect
…, and the number of readings that are really bad in bad_count . Modify. Catch only ValueError . The hidden error then stops the program with a traceback: fix it. It must print: Bad reading: n/a Good…
Showing 31–40 of 76
Challenge
…, and the number of readings that are really bad in bad_count . Modify. Catch only ValueError . The hidden error then stops the program with a traceback: fix it. It must print: Bad reading: n/a Good…
Challenge
…call without a log would return, and store it in third_count . Remove any lines you added before you check. Modify. Give each call without a log its own new list. It must print: Morning: ['ENG-2…
Example
The global keyword allows modifying a global variable inside a function.
Example
Functions enumerate() and range() extend for loop capabilities in Python.
Quiz
Free beginner quiz on Python variables: 15 questions on naming, assignment, data types, type conversion and scope, with instant answers.
Challenge
…with append(), then let a minimum level decide what counts, the way logging tools filter by severity.
Challenge
…in rocket_got , and the position of the pad in the call, counting from 1, in pad_position . Modify. Pass every argument by name, keeping the pad before the rocket in the call, so you can see the order…
Challenge
…every # , row by row, and print its row and column, both counted from 0, as indexes are. Then print how many there are: Debris at row 0, column 2 Debris at row 2, column 5 Debris at row 3, column 0…
Example
Variables store data in your program. Learning to create and name variables in Python.
Example
Accessing list elements by index. Changing and removing elements.