
Shreyansh Jain
@DevTalesShrey
Followers
107
Following
179
Media
100
Statuses
267
Software engineer | IIT Roorkee grad π | Passionate about coding | Blogger π | Networking enthusiast π | Python | C and C++ | JavaScript | Git | React | Node
Bangalore, India
Joined August 2023
Learn Python - Day 13.Topic: Swapping variables in python. # Assuming we have two variables, a and b.a = 1.b = 2. # To swap the values of a and b.a, b = b, a . # Now, a is 2 and b is 1. #SoftwareDevelopment .#SoftwareEngineering .#100DaysOfCode .#buildinpublic #Python
2
3
29
The output from print would typically be a single line which can be hard to read, especially if the dictionary is large. The output from pprint, on the other hand, would be neatly formatted with line breaks and indentation.
0
0
1
In the below example, we have tried to print the data using print and pprint.
1
0
1
Pretty Printing in python:. pprint is a python module that provides a capability to "pretty-print" arbitrary Python data structures in a formatted and more readable way. Thread: π§΅. #Python #pythonprogramming.
1
0
1
Disadvantages of stemming:.β’ Loss of Semantic Meaning.β’ Generation of Non-Words.β’ Overstemming and Understemming Errors.β’ Part-of-Speech Ambiguity.
0
0
2
Advantages of stemming:.β’ Reduction in Vocabulary Size.β’ Increased Recall in Information Retrieval.β’ Faster Processing.β’ Simplicity.β’ Language Support.
1
0
2
Examples of stemming:. running - run.climber - climber.programming - program.programs - program.programmers - programm
1
0
0
Today, I was going through the "solutions" section of one of the Leetcode problems, I stumbled upon my solution, which had around 560 upvotes!. Reading through the comments brightened my day; it was awesome to see positive feedbacks. Have you tried it?.
leetcode.com
Can you solve this real interview question? Sum of Distances in Tree - There is an undirected connected tree with n nodes labeled from 0 to n - 1 and n - 1 edges. You are given the integer n and the...
1
0
2
(5/5): . Thanks for reading. If you like my post, do like π©·, follow @DevTalesShrey and re-tweet β»οΈ. See you in the next post π€.
0
0
0
(3/5): sent_tokenize() is used to generate list of sentences. In the below example we got 4 sentences.
1
0
0
(1/5) Tokenizing in NLP:. When processing natural language text, tokenization usually involves dividing the text into words, phrases, symbols, or other meaningful elements called tokens. Thread: π§΅.
1
0
2
You can use "spellcheck" to check the confidence of the word that it fixes.
0
0
0
You can use the "correct" function of the TextBlob to fix the spellings. In the below example, I am fixing a sentence.
1
0
0
Spelling check using TextBlob (NLP). #Python #NLP .#AI #MachineLearning . TextBlob provides a simple API for common NLP tasks such as POS tagging, phrase extraction and more. One of the features of it is to correct "spelling mistakes" in a given text. Threadπ§΅π½.
1
0
1
String Formatting Operator %. #Python #pythonprogramming . The string formatting operator % allows you to format strings with specific formatting instructions, including inserting values into a string.
0
0
2
I couldn't cover all functions provided by Counter. You can refer this official page for complete guide.
docs.python.org
Source code: Lib/collections/__init__.py This module implements specialized container datatypes providing alternatives to Pythonβs general purpose built-in containers, dict, list, set, and tuple.,,...
0
0
2