From bc6bda612d619868efc5cada8a8ebbc739fa5625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20G=C3=B6r?= Date: Sun, 21 May 2023 12:30:38 +0300 Subject: [PATCH] match while example and as x: --- match.while.2.py | 13 +++++++++++++ match.while.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 match.while.2.py diff --git a/match.while.2.py b/match.while.2.py new file mode 100644 index 0000000..26bcdbd --- /dev/null +++ b/match.while.2.py @@ -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!') \ No newline at end of file diff --git a/match.while.py b/match.while.py index d9559b0..89802ce 100644 --- a/match.while.py +++ b/match.while.py @@ -10,4 +10,4 @@ while True: case 'exit' | 'quit': break case _: - print('geçersiz komut') + print('geçersiz komut!')