Forget about if-elif-else with Match-Case construction Python

Published: 03 August 2022
on channel: Python 5
2,102
97

Python tips and tricks
#shorts #python #programming #coding

a = int(input("Enter some value: "))
if a == 1:
print("Its one")
elif a == 2:
print("Its two")
else:
print("Another value:", a)

match a:
case 1:
print("its one")
case 2:
print("its two")
case default:
print("another value", a)


Watch video Forget about if-elif-else with Match-Case construction Python online without registration, duration hours minute second in high quality. This video was added by user Python 5 03 August 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2,102 once and liked it 97 people.