پایتون ( Machine Learning | Data Science )
23.8K subscribers
488 photos
59 videos
103 files
347 links
◀️اینجا با تمرین و چالش با هم پایتون رو یاد می گیریم

بانک اطلاعاتی پایتون
پروژه / code/ cheat sheet
+ویدیوهای آموزشی

+کتابهای پایتون
تبلیغات:
@alloadv

🔁ادمین :
@maryam3771
Download Telegram
پایتون ( Machine Learning | Data Science )
What is the value of L at the end of execution of the program?
Explanation:
The for loop will run for i = 0 to i = 3, i.e. 4 times(len(L) = 4). 2e-04 is same as 0.0002, thus L[i] = 6.22 + 0.0002 = 6.2202. String addition will result in concatenation, ‘a’ + ‘boy’ = ‘aboy’. False + True is True, it’ll return the integer value of 1. As tuples are immutable, the code will end with TypeError, but elements of L will be updated.


#code #test

🆔 @Python4all_pro
👍8😍1
Media is too big
VIEW IN TELEGRAM
Python Backend Web Development Course (with Django)

This video is a full backend web development course with python. In the course, you will learn everything you need to know to start your web development journey with Python and Django.

Projects Built:

1. A Blog
💻 https://github.com/tomitokko/django-blog
2. A Weather App
💻 https://github.com/tomitokko/weather_detector
3. A Realtime Chat App
💻https://github.com/tomitokko/django-chat-app


🆔 @Python4all_pro
❤‍🔥4👍2🙏1😍1
Pattern 14

n = 7
for i in range(n):
for j in range(n-i, n+1):
print(j, end=" ")
print()



#code #pattern

🆔 @Python4all_pro
👍3🏆1🦄1👾1
Python Certification Preparation:4 Practice Tests for (2024)

Four Python Certification Preparation Tests with Detailed Explanations

🆓 Free
Original Price£59.99
Discount100% off
4 days left at this price!

یودمی یک دوره رایگان تست برای تمرین پایتون گذاشته که به مدت ۴ روز رایگانه، هدف اصلی این دوره این است که شما را به تمرینات و مهارت های ضروری در زمینه توسعه پایتون مجهز کند برای رسیدن به این هدف چهار آزمون تمرینی دقیق ساخته شده که طیف گسترده ای از موضوعات و سطوح مختلف دشواری را در بر می گیرد.

https://www.udemy.com/course/python-certification-preparation-4-practice-tests/?couponCode=662A73F8E048B76A8D08

#Free_course
#udemy

🆔 @Python4all_pro
👍3❤‍🔥1
🔅 Compress Images

from PIL import Image

# https://t.me/LearnPython3

in_img = 'input.png'
out_img = 'compressed.png'

# Open the image
with Image.open(in_img) as img:
# Save the compressed image
img.save(out_img, 'PNG', quality=80)

print(f"Image compressed successfully!")



#code

🆔 @Python4all_pro
👍3😍2
🖥 Lock Your Photos using Python



#code

🆔 @Python4all_pro
👍5🆒1
Extract the colors and their codes from an image


#code

🆔 @Python4all_pro
👏3
🔅 Extract the colors and their codes from an image

from PIL import Image
from collections import Counter

# https://t.me/LearnPython3

# Open the image
image = Image.open('input.png')

# Convert the image to a list of RGB tuples
pixels = list(image.getdata())

# Use Counter to count the occurrences of each color
color_counts = Counter(pixels)

# Get the 6 most common colors
top_colors = color_counts.most_common(6)

# Print the extracted colors and their counts
for i, (color, count) in enumerate(top_colors):
color_block = "\033[48;2;{};{};{}m \033[0m".format(color[0], color[1], color[2])
print(f"Color {i + 1}: {color_block} RGB: {color} - Count: {count}")




#code

🆔 @Python4all_pro
👏3👾1
Pattern 15

n = 7
for i in range(n, 0, -1):
print(" " * i, end="")
for j in range(n-i+1):
print(i, end=" ")
print()



#code #pattern

🆔 @Python4all_pro
👍5
Barcode Generation using Python


#code

🆔 @Python4all_pro
🏆4
5 Ways of Debugging with Python

یک مقاله عالی از Tenderlove - یکی از توسعه دهندگان اصلی Ruby و Rails - نکته اصلی این است که به شما نشان دهد که در بسیاری از موارد، شما به یک دیباگر کامل نیاز ندارید. اشکال زدایی که با یک IDE خوب همراه است یکی از قدرتمندترین ابزارهایی است که یک برنامه نویس می تواند داشته باشد! شما به راحتی می توانید breakpoints را در کد خود قرار دهید، یا متغیرها را در لحظه چک و تغییر دهید. کار با کدهای بزرگ را بسیار آسان‌تر می‌کند و به تازه‌واردها کمک می‌کند تا در پروژه‌های جدید با سرعت بیشتری عمل کنند

https://switowski.com/blog/ipython-debugging/


🆔 @Python4all_pro
👍2
🔅 Convert JPG to PNG
from PIL import Image

im = Image.open("naruto.jpg").convert("RGB")
im.save("naruto.png", "png")


🔅 Convert PNG to JPG
from PIL import Image

im = Image.open("naruto.png").convert("RGB")
im.save("naruto.jpg", "jpeg")


```install
pip install PIL `




#code

🆔 @Python4all_pro
👍2
Convert JPG to PNG


#code

🆔 @Python4all_pro
😍5👍2👾1