為什麼 Python,Go 和 Rust 不支持三元運算符?

https://levelup.gitconnected.com/why-dont-python-go-and-rust-support-the-ternary-operator-9607fcde3efa?source=rss——programming-5

Python, Go, and Rust do not support the ternary operator commonly used in other programming languages. This article explores the reasons for Python’s unique implementation and examines why Go and Rust also lack support. The ternary operator simplifies conditional judgment and value retrieval but poses challenges. Understanding language design can enhance programming skills.

via Programming on Medium

January 19, 2024 at 12:40PM

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *