match while example and as x:

This commit is contained in:
Mert Gör 🇹🇷 2023-05-21 12:30:38 +03:00
parent f0c6948b23
commit bc6bda612d
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
2 changed files with 14 additions and 1 deletions

13
match.while.2.py Normal file
View File

@ -0,0 +1,13 @@
while True:
cmd = input('CSD>').strip()
match cmd:
case 'delete' | 'remove' | 'erase' as x:
print(f'silme işlemi "(x)" komutu ile yapılıyor')
case 'copy':
print('kopyalama işlemi')
case 'rename':
print('isim değiştirme işlemi')
case 'exit' | 'quit':
break
case _:
print('geçersiz komut!')

View File

@ -10,4 +10,4 @@ while True:
case 'exit' | 'quit':
break
case _:
print('geçersiz komut')
print('geçersiz komut!')