sentence=re.sub("[^a-z]+"," ",sentence)
What is 're' in the line, sentence=re.sub(...)?
Hey @guptadiksha534, ‘re’ stands for Regular Expressions. These expressions are used for pattern matching tasks. Like in this case sir have used ‘re’ to substitute anything that is not between a to z with a blank space. So basically re can be used to match certain patterns in your text and then perform the desired action. If you want to study regular expressions in detail, then it is best explained here.
Hope this helps.
Happy Learning