Files
hello-algo/ja/codes/python/modules/vertex.py
Yudong Jin 7257641e0e Retranslate the complete Japanese online edition from Chinese (#2008)
* Retranslate the complete Japanese online edition from Chinese

* Fit Japanese homepage labels and localize heading permalinks

* Point Japanese contribution instructions to the Japanese preview

* Replace locale conditionals with multilingual UI tables
2026-10-30 02:12:26 +08:00

21 lines
529 B
Python

# File: vertex.py
# Created Time: 2023-02-23
# Author: krahets (krahets@163.com)
class Vertex:
"""頂点クラス"""
def __init__(self, val: int):
self.val = val
def vals_to_vets(vals: list[int]) -> list["Vertex"]:
"""値のリスト vals を入力し、頂点のリスト vets を返す"""
return [Vertex(val) for val in vals]
def vets_to_vals(vets: list["Vertex"]) -> list[int]:
"""頂点のリスト vets を入力し、値のリスト vals を返す"""
return [vet.val for vet in vets]