Untitled
unknown
plain_text
a year ago
275 B
5
Indexable
def calculate_length(string): length = 0 for _ in string: length += 1 return length def print_aligned_length(string): length = calculate_length(string) print(f"{length:>{length}} {string}") # Example usage: print_aligned_length("Hello, world!")
Editor is loading...
Leave a Comment