Challenge
Sensor ID parts
Split a sensor ID like ENG-2 into its subsystem and its unit number as an int, work out the next ID, then handle subsystems with a dash in their name using rsplit().
Showing 31–40 of 65
Challenge
Split a sensor ID like ENG-2 into its subsystem and its unit number as an int, work out the next ID, then handle subsystems with a dash in their name using rsplit().
Challenge
Print status lines that a monitoring system reads character by character. A first Python challenge on exact output with print(), right in your browser.
Quiz
…on quotes, escape characters, sep, end, flush and f-string formatting, with instant answers.
Quiz
…for beginners: 20 multiple-choice questions on print(), strings, lists, dictionaries, loops and functions, with instant answers.
Quiz
…beginner quiz on Python for loops: 15 questions on lists, strings, range(), enumerate(), totals and break, with instant answers.
Challenge
…place, then draw the crew display's ten-segment gauge with string repetition and int().
Article Mini projects
…numpy as np # numpy.base_repr(number, base) returns a string print(np.base_repr(12, 6)) # Output: 20 print(np.base_repr(36, 6)) # Output: 100 print(np.base_repr(101, 6)) # Output: 245…
Article Mini projects
…= event.copy() stored_hmac = event_copy.pop('hmac') event_string = json.dumps(event_copy, sort_keys=True) expected_hmac = self._compute_hmac(event_string) if expected_hmac != stored_hmac: raise…
Example
Special characters like \n and \t allow formatting text with new lines and tabs.
Article Python Fundamentals
…complex(100, 20) # Creating from real and imaginary parts Strings (str) Text data, useful for storing names and descriptions: mission_name = "Artemis" spacecraft_status = 'Ready for launch' Boolean…