- random(): Returns a random float number between 0 and 1
- sample(): Returns a given sample of a sequence
- shuffle(): Takes a sequence and returns the sequence in a random order
- choice(): Returns a random element from the given sequence
- choices(): Returns a list with a random selection from the given sequence
- randint(): Returns a random number between the given range
- uniform(): Returns a random float number between two given parameters
Tuesday, 29 March 2022
Friday, 25 March 2022
Sequence Matcher in Python
Python Coding March 25, 2022 Python No comments
#!/usr/bin/env python
# coding: utf-8
# # Sequence Matcher in Python
# In[3]:
from difflib import SequenceMatcher
text1 = input("Enter 1st sentence : ")
text2 = input("Enter 2nd sentence : ")
sequenceScore = SequenceMatcher(None, text1, text2).ratio()
print(f"Both are {sequenceScore * 100} % similar")
#clcoding.com
# In[ ]:
Age Calculator using Python
Python Coding March 25, 2022 Python No comments
Saturday, 19 March 2022
Image to Pencil Sketch in Python
Python Coding March 19, 2022 Python No comments
Sunday, 13 March 2022
Voice Recorder in Python
Python Coding March 13, 2022 Python No comments
Download YouTube videos in Python
Python Coding March 13, 2022 Python No comments
Captcha in Python
Python Coding March 13, 2022 Python No comments
Secrets Python module
Python Coding March 13, 2022 Python No comments
Saturday, 5 March 2022
Mouse and keyboard automation using Python
Python Coding March 05, 2022 Python No comments
Friday, 4 March 2022
Python Secrets Module
Python Coding March 04, 2022 Python No comments
Popular Posts
-
Execution Flow: The first if(True) condition is True , so the code inside it runs. It prints "0" . Inside the first if bloc...
-
Introduction to Data Science in Python: Course Review and Insights Python has become one of the most powerful and popular programming lang...
-
Step-by-Step Execution: Initialization: number = 0 First Iteration (Loop Start - number = 0 ): number += 4 → number = 4 if number...
-
Explanation: List Initialization: colors = ["Red", "Yellow", "Orange"] A list named colors is created wit...
-
Step-by-Step Execution: height = 185 if not (height == 170): height == 170 is False because 185 != 170 not False → True So, print(...
-
Step-by-step Execution: Outer Loop ( for i in range(0, 1) ) : range(0, 1) generates the sequence [0], so the loop runs once with i = 0...
-
Step-by-Step Breakdown: Importing the array module import array as arr The array module is a built-in Python module that provides...
-
Explanation: number = 7: Assigns the value 7 to the variable number. if(number == 7): Checks if number is equal to 7. This condition is...
-
In today's fast-evolving technological landscape, machine learning has become a key driver of innovation across industries. Whether yo...
-
Linear Algebra for Machine Learning and Data Science Introduction Linear algebra is a fundamental mathematical tool that plays a crucial r...