pattern in python
rows = 6 #Pattern(1,121,12321,1234321,123454321)
for i in range(1, rows + 1):
for j in range(1, i - 1):
print(j, end=" ")
for j in range(i - 1, 0, -1):
print(j, end=" ")
print()
pattern in python
rows = 6 #Pattern(1,121,12321,1234321,123454321)
for i in range(1, rows + 1):
for j in range(1, i - 1):
print(j, end=" ")
for j in range(i - 1, 0, -1):
print(j, end=" ")
print()
python regex
import re
# Regex Cheat sheet : https://www.dataquest.io/blog/regex-cheatsheet/
# Regex python tester : https://pythex.org/
# re doc : https://docs.python.org/3/library/re.html
text = "i like train"
reg = r"[a-c]" #the group of char a to c
if re.match(reg, text): #Check if regex is correct
print(text)
else:
print("Not any match")
python regex tester
Find below are online regex tester
https://regex101.com/
https://pythex.org/
http://www.pyregex.com/
https://www.debuggex.com/
Here you insert your regular expression and get the test result.
Thank you !!!
python exec
# exec lets us run strings as normal python code
program = "print('Hello there!')"
exec(program)
python regex
import re
>>> m = re.search('(?<=abc)def', 'abcdef')
>>> m.group(0)
'def'
python regex
import re
txt = "The rain in Spain"
x = re.search("^The.*Spain$", txt)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us