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")
1 Antwort
+ 6
Match-case was introduced in Python 3.10.
The Python version in playground is 3.9, which doesn't support match-case.