So, ive been doing my python project for some time, got a big problem about a func
https://pastebin.com/u6ZHXbxc
this function converts goes through each ‘e’type in price and checks if its more points in POINTS dict (or if its equal)
however, if its less, it tries to find if theres a bigger ‘e’ type in points that has atleast 1 point, and then it converts it from 1 to 1000, from ‘e’type to ‘e’type-3.
it then checks if successful actions are equal to the points len and then if its true, send the new points and when false – False (bool)
when i try this function with these lines of code:
points = {"e0":101, "e3":0}
price = {"e0":1, "e3":2}
print(buycheck(points, price), points)
it makes something with the points dict and somehow changes it, even though i dont ask to return the new points dict
**also i understood now that somehow python changes all the dicts even if theyre copies of another, it changes like every dict in this func, both the original one and the copy
how can i change it, or what i should with my func (there are some problems left with buycheck (for example:
points = {"e0":101, "e3":1}
price = {"e0":1, "e3":2}
it gives -2 in the dict), but i think ill try to fix them by myself. ?**
i tried changing the return func, but it still doesnt work
Noway is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.