pascalabcnet/TestSuiteAdditionalLanguages/SPythonTests/CompilationSamples/int_bool_conversion.pys
Александр Земляк 2c30b73b08
SPython: неявное преобразование int в bool и bool в int (#3383)
* Implement bool to int and int to bool implicit conversion for SPython

* Change "and", "or" and "not" operations to be logical in SPython

* Add standard functions' overloads (all, any, sum)
2026-02-02 12:01:18 +03:00

17 lines
246 B
Plaintext

# int to bool and bool to int implicit conversion
a: int = True
b: bool = 5
if 10:
print((1 > 0) + 1)
while 0:
print('Infinite loop')
print(bool(1))
print(filter(bool, [0, 1, 2]))
print(all([0, 1, 3]))
print(sum([True, False, True]))