summaryrefslogtreecommitdiff
path: root/progs/a222.py
diff options
context:
space:
mode:
Diffstat (limited to 'progs/a222.py')
-rw-r--r--progs/a222.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/progs/a222.py b/progs/a222.py
new file mode 100644
index 0000000..84fff5e
--- /dev/null
+++ b/progs/a222.py
@@ -0,0 +1,11 @@
+import re
+def check_substring(string, sample) :
+ if (sample in string):
+ y = "\A" + sample
+ x = re.search(y, string)
+ if x :
+ return ("string starts with the given substring")
+ else :
+ return ("string doesnt start with the given substring")
+ else :
+ return ("entered string isnt a substring") \ No newline at end of file