Question
import re; import sys; def rgex(string, pattern): string = re.findall(pattern, string); a = for x in string: a+=x; return (a); def norm(string): string =
import re; import sys;
def rgex(string, pattern): string = re.findall(pattern, string); a = "" for x in string: a+=x; return (a); def norm(string): string = rgex(string, r'[a-zA-Z0-9]* ?'); string = rgex(string, r'\w{4,} ?');
return string.lower(); def jac(st1, st2): leno = min(len(st1), len(st2)); count = 0; for i in range(leno): if(st1[i]==st2[i]): count+=1; return count/(len(st1)+len(st2)-count)
def main(): string1 = norm(input()); string2 = norm(input()); print(jac(string1, string2));
if __name__ == "__main__": main()
achieve the same functionality without using the rgex function
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started