Forwarded from ˹ᴍʀ sᴜᴋᴋᴜɴ˼ (Mukesh test bot)
This media is not supported in your browser
VIEW IN TELEGRAM
👩💻 Wᴇʟᴄᴏᴍᴇ ᴛᴏ @CodesSnippet! 🚀
Jᴏɪɴ ᴜs ғᴏʀ ᴅᴀɪʟʏ sɴɪᴘᴘᴇᴛs ᴏғ ᴄᴏᴅɪɴɢ 🧩 ᴋɴᴏᴡʟᴇᴅɢᴇ! 💻💡
Hᴇʀᴇ, ʏᴏᴜ'ʟʟ ғɪɴᴅ 👀 ʙɪᴛᴇ-sɪᴢᴇᴅ ᴘɪᴇᴄᴇs ᴏғ ᴄᴏᴅᴇ, 🔥 ᴘʀᴏɢʀᴀᴍᴍɪɴɢ ᴛɪᴘs, ᴀɴᴅ ᴛʀɪᴄᴋs ᴛᴏ ʟᴇᴠᴇʟ ᴜᴘ ʏᴏᴜʀ ᴄᴏᴅɪɴɢ sᴋɪʟʟs! 💪💻
Sᴛᴀʏ ᴜᴘᴅᴀᴛᴇᴅ ᴏɴ ᴛʜᴇ ʟᴀᴛᴇsᴛ ᴛʀᴇɴᴅs ɪɴ ᴛʜᴇ ᴛᴇᴄʜ ᴡᴏʀʟᴅ ᴀɴᴅ ᴇɴɢᴀɢᴇ ᴡɪᴛʜ ғᴇʟʟᴏᴡ ᴄᴏᴅᴇʀs 🤝 ɪɴ ᴏᴜʀ ᴠɪʙʀᴀɴᴛ ᴄᴏᴍᴍᴜɴɪᴛʏ! 🌐💬
Lᴇᴛ's ᴄʀᴀᴄᴋ ᴛʜᴇ ᴄᴏᴅɪɴɢ 🚪 ᴛᴏɢᴇᴛʜᴇʀ ᴀɴᴅ ʙʀɪɴɢ ʏᴏᴜʀ ᴘʀᴏJᴇᴄᴛs ᴛᴏ ʟɪғᴇ!
#CodeSnippet
#ProgrammingFun
Jᴏɪɴ ᴜs :- @CodesSnippet
Jᴏɪɴ ᴜs ғᴏʀ ᴅᴀɪʟʏ sɴɪᴘᴘᴇᴛs ᴏғ ᴄᴏᴅɪɴɢ 🧩 ᴋɴᴏᴡʟᴇᴅɢᴇ! 💻💡
Hᴇʀᴇ, ʏᴏᴜ'ʟʟ ғɪɴᴅ 👀 ʙɪᴛᴇ-sɪᴢᴇᴅ ᴘɪᴇᴄᴇs ᴏғ ᴄᴏᴅᴇ, 🔥 ᴘʀᴏɢʀᴀᴍᴍɪɴɢ ᴛɪᴘs, ᴀɴᴅ ᴛʀɪᴄᴋs ᴛᴏ ʟᴇᴠᴇʟ ᴜᴘ ʏᴏᴜʀ ᴄᴏᴅɪɴɢ sᴋɪʟʟs! 💪💻
Sᴛᴀʏ ᴜᴘᴅᴀᴛᴇᴅ ᴏɴ ᴛʜᴇ ʟᴀᴛᴇsᴛ ᴛʀᴇɴᴅs ɪɴ ᴛʜᴇ ᴛᴇᴄʜ ᴡᴏʀʟᴅ ᴀɴᴅ ᴇɴɢᴀɢᴇ ᴡɪᴛʜ ғᴇʟʟᴏᴡ ᴄᴏᴅᴇʀs 🤝 ɪɴ ᴏᴜʀ ᴠɪʙʀᴀɴᴛ ᴄᴏᴍᴍᴜɴɪᴛʏ! 🌐💬
Lᴇᴛ's ᴄʀᴀᴄᴋ ᴛʜᴇ ᴄᴏᴅɪɴɢ 🚪 ᴛᴏɢᴇᴛʜᴇʀ ᴀɴᴅ ʙʀɪɴɢ ʏᴏᴜʀ ᴘʀᴏJᴇᴄᴛs ᴛᴏ ʟɪғᴇ!
#CodeSnippet
#ProgrammingFun
Jᴏɪɴ ᴜs :- @CodesSnippet
❤1
Forwarded from Cᴏᴅᴇs Sɴɪᴘᴘᴇᴛs (s ʜ ɪ ɴ ᴇ)
Pattern Challenge..
>> Approx Time:
Jᴏɪɴ ᴜs :- @CodesSnippet
# Hollow Rectangle of '*'
def hollow_pattern(row, col):
for i in range(row):
for j in range(col):
if i == 0 or i == row-1 or j == 0 or j == col-1:
print('* ', end='')
else:
print(' ', end='')
print('')
>> Approx Time:
6.67msJᴏɪɴ ᴜs :- @CodesSnippet
_1_Introduction_To_Data_Structurepdf_lyst1084.pdf
6.1 MB
_1_Introduction_To_Data_Structurepdf_lyst1084.pdf
#Dsa basics pdf
Join :- @Python_Codes_Pro
Support group :- @python_group_pro
#Dsa basics pdf
Join :- @Python_Codes_Pro
Support group :- @python_group_pro
Scrap Image from google using BeautifulSoup
#CodeSnippet
#ProgrammingFun
Language:
Join :- @Python_Codes_Pro
Support group :- @python_group_pro
import requests
from bs4 import BeautifulSoup as BSP
def get_image_urls(search_query):
url = f"https://www.google.com/search?q={search_query}&tbm=isch"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
}
rss = requests.get(url, headers=headers)
soup = BSP(rss.content, "html.parser")
all_img = []
for img in soup.find_all('img'):
src = img['src']
if not src.endswith("gif"):
all_img.append(src)
return all_img
print(get_image_urls("boy"))
#CodeSnippet
#ProgrammingFun
Language:
PythonJoin :- @Python_Codes_Pro
Support group :- @python_group_pro
Forwarded from ˹ᴍʀ sᴜᴋᴋᴜɴ˼ (Mᴜᴋᴇsʜ)
Search hd image from unsplash using mukesh api
#CodeSnippet
#ProgrammingFun
Language:
Jᴏɪɴ ᴜs :- @CodesSnippet
import requests
ask = input("query to search image:- ")
class Unsplash:
base_url = "https://mukesh-api.vercel.app/"
"""search image from unsplash api by @mr_sukkun"""
def __init__(self, ask) -> None:
self.ask = ask
def unsplash_reply(self):
url = f"{self.base_url}unsplash?query={self.ask}"
response = requests.get(url)
if response.status_code == 200:
return response.json()
else:
return {"error": "Failed to fetch data"}
x = Unsplash(ask)
print(x.unsplash_reply())
#CodeSnippet
#ProgrammingFun
Language:
PythonJᴏɪɴ ᴜs :- @CodesSnippet
❤2
Scrap Image from bing using BeautifulSoup
sample response :
#CodeSnippet
#ProgrammingFun
Language:
Join :- @Python_Codes_Pro
Support group :- @python_group_pro
import requests
from bs4 import BeautifulSoup as BSP
def split_url(url):
return url.split('&')[0]
def get_image_urls(search_query):
url = f"https://cn.bing.com/images/search?q={search_query}&first=1&cw=1177&ch=678"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
}
rss = requests.get(url, headers=headers)
soup = BSP(rss.content, "html.parser")
all_img = []
for img in soup.find_all('img'):
img_url = img.get('src2')
if img_url and img_url.startswith('https://tse2.mm.bing.net/'):
img_url = split_url(img_url)
all_img.append(img_url)
return all_img
print(get_image_urls("cat"))
sample response :
['https://tse2.mm.bing.net/th?q=Cat+Portrait', ...']
#CodeSnippet
#ProgrammingFun
Language:
PythonJoin :- @Python_Codes_Pro
Support group :- @python_group_pro
❤1👍1👏1
Guess the output ?
string = "Lorem ipsum dolor sit amet"
words = string.split(" ")
word_counts = {}
for word in words:
word = word.lower()
word_counts[word] = word_counts.get(word, 0) + 1
print(word_counts)
Looking for Udemy courses with 100% off coupon codes? Then you're in the right place. All you need to do is sign-up in Udemy and enroll for the course and you will have it FREE FOREVER with certificate.
Need Udemy API ? 💀
Will be posted on 100 Subscribers on @CodesSnippet channel
Join Now : @CodesSnippet 🥀
Support group :- @python_group_pro
Sample response
{ "category": "coding",
"courseLink": "https://www.udemy.com/course/learn-python-programming-with-jafricode-tutorials/?couponCode=07FA1B16A696A564ECD2"...}❤1👍1🆒1
Scrap Leetcode information using Mukesh-Api
Language: Python
Join :- @Python_Codes_Pro
Support group :- @python_group_pro
import cloudscraper
def fetch_leetcode_information(query=""):
"""
Fetches leetcode information from a given API based on the query parameter.
Args:
query (str): The query to filter the results, defaults to an empty string.
Returns:
dict: Key-value pairs extracted from the fetched JSON data.
"""
base_url = "https://mukesh-api.vercel.app/leetcode"
if query:
url = f"{base_url}?query={query}"
else:
query = input("Please enter a query: ")
url = f"{base_url}?query={query}"
scraper = cloudscraper.create_scraper()
response = scraper.get(url).json()
return response.get("results", {})
# example
query = "noob-mukesh"
data = fetch_leetcode_information(query)
for key, value in data.items():
print(f"{key}: {value}")
Language: Python
Join :- @Python_Codes_Pro
Support group :- @python_group_pro
❤2👍1
🎉 Thank you so much for being the 1500th member of our python coding channel! 🥳 Your presence is highly appreciated and welcomed in advance. 🙌 Feel free to share the knowledge and join the discussions at
@Python_Codes_Pro.
Also, don't forget to check out our support group with 400 members for engaging discussions and help at
@python_group_pro
. 🚀 Let's learn and grow together in the world of coding! 💻🌟
Join :- @Python_Codes_Pro
Support group :- @python_group_pro
@Python_Codes_Pro.
Also, don't forget to check out our support group with 400 members for engaging discussions and help at
@python_group_pro
. 🚀 Let's learn and grow together in the world of coding! 💻🌟
Join :- @Python_Codes_Pro
Support group :- @python_group_pro
👍2❤1
Guess the Output:
Leave answer in comment:
Join :- @Python_Codes_Pro
Support group :- @python_group_pro
Leave answer in comment:
Join :- @Python_Codes_Pro
Support group :- @python_group_pro
❤1
What will be the output of the following Python code?
Anonymous Quiz
29%
m, y, , n, a, m, e, , i, s, , x,
16%
m, y, , n, a, m, e, , i, s, , x
43%
my, name, is, x,
12%
error
❤2👍2
In Python, the exec() function is used to execute dynamically created Python code. It takes a string as an argument which holds the Python code that you want to execute.
# Define the Python code as a string
code="""for i in range(1,10+1):
print(i)"""
exec(code)
❤1👍1
*
+++
*****
+++++++
*********
+++++++++++
*************
+++++++++++++++
*****************
+++++++++++++++
*************
+++++++++++
*********
+++++++
*****
+++
*👍1