Skip to content
Advertisement

Addition of variables

I ran into a problem when adding variables. Their values ​​are glued together, but I need to calculate

a = check1()
b = check2()
c = check3()
d = check4()
g = check5()
e = check6()
f = check7()
g = сheck8()
i = сheck9()

online = a + b + c + d + g + e + f + g + i

functions are all identical:

def check1():
    with valve.source.a2s.ServerQuerier(a) as server:
        info = server.info()
        players = server.players()
        return '{player_count}'.format(**info)

I get as a result: 007220000

how to count them?

Advertisement

Answer

It would be of great help if you pasted the whole code segment here, including the functions. It seems to me that you are returning the values from those functions as strings.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement