forked from SaptakBhoumik/Peregrine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
working on match and case statement. the problem is nested match and …
…case statement dont work as of now but will be fixed soon
- Loading branch information
1 parent
104ce55
commit 093a0d5
Showing
8 changed files
with
210 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
def main(): | ||
match "hi": | ||
case "hi" or "Hi": | ||
print("ok\n") | ||
else: | ||
print("Error\n") | ||
match 100.6: | ||
case 10.7: | ||
print("Error\n") | ||
case 100.6: | ||
print("OK\n") | ||
default: | ||
print("Will always be executed if you dont add break in case\n") | ||
match "saptak": | ||
case "x": | ||
match "bhoumik": | ||
case "y": | ||
print("Something is wrong") | ||
default: | ||
print("Something is wrong") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def main(): | ||
print("Hello"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
def main(): | ||
if "a"==NULL: | ||
print("Not ok") | ||
if "a"!=NULL: | ||
print("Ok\n") | ||
str a=NULL | ||
if a!=NULL: | ||
print("Not Ok\n") | ||
if a==NULL: | ||
print("All ok") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters