0

Whats wrong

a = "Singapore" Match a : case 'Singapore': print(data.get['Singapore']) case 'Ireland': print(data.get('Ireland')) break case 'United Kingdom': print(data.get('United Kingdom')) case 'Germany': print(data.get('Germany')) case 'Armenia': print(data.get('Armenia')) case 'United States': print(data.get('United States')) case 'Canada': print(data.get('Canada')) case 'Italy': print(data.get('Italy')) case _: print("no country found")

30th Nov 2023, 12:14 PM
Aryan ||
1 Answer
+ 6
Match-case was introduced in Python 3.10. The Python version in playground is 3.9, which doesn't support match-case.
30th Nov 2023, 12:48 PM
Wong Hei Ming
Wong Hei Ming - avatar