Which one of the following statements is correct regarding binary operations in Python?
Explanation
Binary operations in Python can be performed over operands of different data types in Python as long as types are compatible. For example,
a = 1 + 3.14 is fine, but
a = 1 + “Hello, world” will throw a TypeError. In case when operands have different data types, more narrow one will be automatically converted to a wider data type. In previous example integer 1 will be converted to its float representation and added to 3.14 providing a float result.

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Продолжайте изучать
тесты по Python
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты