mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-06 18:49:26 +08:00
Pyupgrade to python3.8 (#3616)
* Upgrade to Python 3.8 syntax * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -7,7 +7,7 @@ from collections.abc import Sequence
|
||||
from queue import Queue
|
||||
|
||||
|
||||
class SegmentTreeNode(object):
|
||||
class SegmentTreeNode:
|
||||
def __init__(self, start, end, val, left=None, right=None):
|
||||
self.start = start
|
||||
self.end = end
|
||||
@ -17,10 +17,10 @@ class SegmentTreeNode(object):
|
||||
self.right = right
|
||||
|
||||
def __str__(self):
|
||||
return "val: %s, start: %s, end: %s" % (self.val, self.start, self.end)
|
||||
return f"val: {self.val}, start: {self.start}, end: {self.end}"
|
||||
|
||||
|
||||
class SegmentTree(object):
|
||||
class SegmentTree:
|
||||
"""
|
||||
>>> import operator
|
||||
>>> num_arr = SegmentTree([2, 1, 5, 3, 4], operator.add)
|
||||
|
Reference in New Issue
Block a user