mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-06 10:31:29 +08:00
Change occurrences of str.format to f-strings (#4118)
* f-string update rsa_cipher.py * f-string update rsa_key_generator.py * f-string update burrows_wheeler.py * f-string update non_recursive_segment_tree.py * f-string update red_black_tree.py * f-string update deque_doubly.py * f-string update climbing_stairs.py * f-string update iterating_through_submasks.py * f-string update knn_sklearn.py * f-string update 3n_plus_1.py * f-string update quadratic_equations_complex_numbers.py * f-string update nth_fibonacci_using_matrix_exponentiation.py * f-string update sherman_morrison.py * f-string update levenshtein_distance.py * fix lines that were too long
This commit is contained in:
@ -475,11 +475,13 @@ class RedBlackTree:
|
||||
from pprint import pformat
|
||||
|
||||
if self.left is None and self.right is None:
|
||||
return "'{} {}'".format(self.label, (self.color and "red") or "blk")
|
||||
return f"'{self.label} {(self.color and 'red') or 'blk'}'"
|
||||
return pformat(
|
||||
{
|
||||
"%s %s"
|
||||
% (self.label, (self.color and "red") or "blk"): (self.left, self.right)
|
||||
f"{self.label} {(self.color and 'red') or 'blk'}": (
|
||||
self.left,
|
||||
self.right,
|
||||
)
|
||||
},
|
||||
indent=1,
|
||||
)
|
||||
|
Reference in New Issue
Block a user