
import math






def 						__magic_name__			(   __a      :	int						):



     '''simple docstring'''




     UpperCamelCase__				=    0
     UpperCamelCase__				=    0
     while num > 0:
          UpperCamelCase__				=    num % 8
          UpperCamelCase__				=    octal + (remainder * math.floor(math.pow(10	,		__a						)						))
          counter += 1
          UpperCamelCase__				=    math.floor(num / 8						)  # basically /= 8 without remainder if any
          # This formatting removes trailing '.0' from `octal`.
     return f"0o{int(__a						)}"






def 						__magic_name__			(   ):



     '''simple docstring'''




     print("""\n2 in octal is:"""						)
     print(decimal_to_octal(2						)						)  # = 2
     print("""\n8 in octal is:"""						)
     print(decimal_to_octal(8						)						)  # = 10
     print("""\n65 in octal is:"""						)
     print(decimal_to_octal(65						)						)  # = 101
     print("""\n216 in octal is:"""						)
     print(decimal_to_octal(216						)						)  # = 330
     print("""\n512 in octal is:"""						)
     print(decimal_to_octal(512						)						)  # = 1000
     print("""\n"""						)


if __name__ == "__main__":
    main()







from __future__ import annotations

from collections import Counter
from random import random




class      __A:

  """simple docstring"""







  def __init__(self						):
       UpperCamelCase__				=    {}







  def 	UpperCAmelCase_ (self	,      SCREAMING_SNAKE_CASE_						):
       UpperCamelCase__				=    {}







  def 	UpperCAmelCase_ (self	,      SCREAMING_SNAKE_CASE_	,      SCREAMING_SNAKE_CASE_	,      SCREAMING_SNAKE_CASE_						):
       if nodea not in self.connections:
            self.add_node(SCREAMING_SNAKE_CASE_						)
       if nodea not in self.connections:
            self.add_node(SCREAMING_SNAKE_CASE_						)
       UpperCamelCase__				=    probability







  def 	UpperCAmelCase_ (self						):
       return list(self.connections						)







  def 	UpperCAmelCase_ (self	,      SCREAMING_SNAKE_CASE_						):
       UpperCamelCase__				=    0
       UpperCamelCase__				=    random()

       for dest in self.connections[node]:
            current_probability += self.connections[node][dest]
            if current_probability > random_value:
                 return dest
       return ""






def 						__magic_name__			(   __a      :	str	,		__a      :	list[tuple[str, str, float]]	,		__a      :	int						):



     '''simple docstring'''




     UpperCamelCase__				=    MarkovChainGraphUndirectedUnweighted()

     for nodea, nodea, probability in transitions:
          graph.add_transition_probability(__a	,		__a	,		__a						)

     UpperCamelCase__				=    Counter(graph.get_nodes()						)
     UpperCamelCase__				=    start

     for _ in range(__a						):
          UpperCamelCase__				=    graph.transition(__a						)
          visited[node] += 1

     return visited


if __name__ == "__main__":
    import doctest

    doctest.testmod()





