- 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
-
Exploring Python Web Scraping with Coursera’s Guided Project In today’s digital era, data has become a crucial asset. From market trends t...
-
What does the following Python code do? arr = [10, 20, 30, 40, 50] result = arr[1:4] print(result) [10, 20, 30] [20, 30, 40] [20, 30, 40, ...
-
Explanation: Tuple t Creation : t is a tuple with three elements: 1 → an integer [2, 3] → a mutable list 4 → another integer So, t looks ...
-
What will the following code output? a = [1, 2, 3] b = a[:] a[1] = 5 print(a, b) [1, 5, 3] [1, 5, 3] [1, 2, 3] [1, 2, 3] [1, 5, 3] [1, 2, ...
-
What will the following Python code output? What will the following Python code output? arr = [1, 3, 5, 7, 9] res = arr[::-1][::2] print(re...
-
Through a recent series of breakthroughs, deep learning has boosted the entire field of machine learning. Now, even programmers who know c...
-
What will the following code output? import pandas as pd data = {'Name': ['Alice', 'Bob'], 'Age': [25, 3...
-
What will the output of the following code be? def puzzle(): a, b, *c, d = (10, 20, 30, 40, 50) return a, b, c, d print(puzzle()) ...
-
Step-by-Step Explanation: Dictionary Creation: my_dict = {'a': 1, 'b': 2, 'c': 3} A dictionary named my_dict is crea...