From 56524faf47d7011804d002e06416242548e4b5ba Mon Sep 17 00:00:00 2001 From: sakshimuttha578 Date: Sat, 26 Jul 2025 20:30:16 +0530 Subject: [PATCH] Added ternary operator in conditionals --- python_sandbox_finished/conditionals.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python_sandbox_finished/conditionals.py b/python_sandbox_finished/conditionals.py index 7c07182..08f8e5e 100644 --- a/python_sandbox_finished/conditionals.py +++ b/python_sandbox_finished/conditionals.py @@ -64,4 +64,7 @@ # is not if x is not y: - print(x is not y) \ No newline at end of file + print(x is not y) + +# Ternary Operator +print(f'{x} is greater than {y}') if x>y else print(f'{y} is greater than {x}') \ No newline at end of file