python-CSD-kursu/python-temel/while.case.py

14 lines
536 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

while True:
cmd = input('CSD>').split()
match cmd:
case ('delete', path) | ('remove', path) | ('erase', path):
print(f'{path} dosyası siliniyor')
case 'copy', source_path, dest_path:
print(f'{source_path} dosyası {dest_path} olarak kopyalanıyor')
case 'rename', oldname, newname:
print(f'{oldname} dosyasının ismi {newname} olarak değiştiriliyor')
case 'exit' | 'quit':
break
case _:
print('geçersiz komut!')