Example
Methods find, count, replace and split
Searching, replacing and splitting text. Advanced string manipulation methods.
Showing 11–20 of 233
Example
Searching, replacing and splitting text. Advanced string manipulation methods.
Challenge
…console: record every change to the hold in a history list and show it with a history command, then add undo, which takes the last change off the history and reverses it.
Challenge
Add a docstring to fuel_needed() that says what it returns and what the reserve means, then add type hints for its parameters and return value; the tests read both from the function itself.
Quiz
Free beginner quiz on Python type conversion and input(): 15 questions on int(), float(), str(), bool() and reading numbers from the user.
Quiz
Free beginner quiz on Python *args and **kwargs: 15 questions on extra arguments, tuples, dictionaries, and * and ** in calls. Instant answers.
Article Python Fundamentals
Learn Python variables and data types - the building blocks of programming. Discover how to store numbers, text, and complex data structures effectively while following best practices for clean and…
Challenge
…only if the wind is under 30 km/h, there is no lightning and range safety reports GO, using and and not, then print every rule that is holding the launch.
Challenge
…7.6612 as Speed: 7.66 km/s, 1234567 as Mass: 1,234,567 kg and a fuel fraction as a percentage, using format specs in f-strings.
Challenge
…built from three nested ifs into one condition joined with and, keeping the output exactly the same, then rewrite it as a flat if/elif chain that reports the first check that failed.
Quiz
…questions on conditions, counters, infinite loops, break and continue, with instant answers.