Quiz
Python Basics Quiz
…day. What the quiz covers Comments, print() with sep and end , f-strings Variable names, data types and type conversion Arithmetic: // , % , ** and operator precedence Strings: indexing, slicing and…
Showing 21–30 of 75
Quiz
…day. What the quiz covers Comments, print() with sep and end , f-strings Variable names, data types and type conversion Arithmetic: // , % , ** and operator precedence Strings: indexing, slicing and…
Quiz
Free beginner quiz on Python for loops: 15 questions on lists, strings, range(), enumerate(), totals and break, with instant answers.
Example
Accessing list elements by index. Changing and removing elements.
Challenge
add_reading() appends to the list it receives, so the caller's stored readings change too. Predict the first line, prove both names share one list, fix it by returning a new list, then write a filter…
Example
For loop iterates through sequence elements. Basic iteration over lists.
Example
Adding and removing elements from a set. Basic set operations.
Example
Adding and removing elements from list. Methods append, insert, pop and remove.
Example
Useful methods for working with text: changing case, removing whitespace.
Article Python Fundamentals
…the parentheses still have to be there. The colon at the end of the line is required. Forgetting it is probably the most common syntax error in this whole topic. Everything indented under the def line…
Article Python Fundamentals
…rover_found = name break if rover_found: print("🔴", end=" ") # Rover! else: print("⚫", end=" ") # Empty surface print() # New line after each row # List of found rovers print("\n=== FOUND ROVERS…