MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __str__

Method __str__

searches/hill_climbing.py:75–83  ·  view source on GitHub ↗

string representation of the current search state. >>> str(SearchProblem(0, 0, 1, None)) 'x: 0 y: 0' >>> str(SearchProblem(2, 5, 1, None)) 'x: 2 y: 5'

(self)

Source from the content-addressed store, hash-verified

73 return False
74
75 def __str__(self):
76 """
77 string representation of the current search state.
78 >>> str(SearchProblem(0, 0, 1, None))
79 'x: 0 y: 0'
80 >>> str(SearchProblem(2, 5, 1, None))
81 'x: 2 y: 5'
82 """
83 return f"x: {self.x} y: {self.y}"
84
85
86def hill_climbing(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected