Python3 Programming 💡

Description
كل ما يخص البرمجة بلغة python :
-كورسات
-مشاريع
-ادوات
-..الخ
We recommend to visit

Official Telegram Channel by Sarkari Result SarkariResult.Com
Welcome to this official Channel of Sarkari Result SarkariResult.Com - On this page you will get all the updated information on Sarkari Result website from time to time.

Last updated 1 week, 4 days ago

?Only Current Affairs English & Hindi Medium.
Contact @GKGSAdminBot
Channel Link- https://t.me/+wytqxfcVInNjN2E1

By Chandan Kr Sah
Email- [email protected]

Must Subscribe Us On YouTube - https://youtube.com/channel/UCuxj11YwYKYRJSgtfYJbKiw

Last updated 1 year, 10 months ago

✆ Contact ? @Aarav723

#UPSC, #SSC , #CGL #BPSC #STATE #PET #Banking, #Railway, #Mppsc, #RRB, #IBPS, #Defence, #Police, #RBI etc.

??This Channel Has Been Established With The Aim Of Providing Proper Guidance To Youths Preparing For All Govt Exam

Last updated 2 months ago

1 month, 1 week ago

Top 6 API Architecture Styles

  1. REST (Representational State Transfer)

- Description: REST is an architectural style that uses standard HTTP methods (GET, POST, PUT, DELETE) for communication. It emphasizes stateless interactions and is resource-oriented, where resources are identified by URIS.

- Use Cases: Web services, mobile applications, and CRUD operations.

  1. GraphQL

- Description: GraphQL is a query language for APIs that allows clients to request exactly the data they need. It provides a single endpoint for fetching data and allows for more dynamic interactions.

- Use Cases: Complex applications needing flexible data retrieval, such as social media platforms and dashboards.

  1. WebSockets

- Description: WebSockets provide a full-duplex communication channel over a single TCP connection. They enable real-time communication between the client and server.

- Use Cases: Real-time applications like chat apps, online gaming, and collaborative tools.
4. Webhooks

- Description: Webhooks are user-defined HTTP callbacks

that are triggered by specific events in a web application. When an event occurs, a request is sent to a predefined URL.

- Use Cases: Integrating different systems, notifications, and event-driven architectures.

  1. gRPC (gRPC Remote Procedure Calls)

- Description: gRPC is an open-source RPC framework that

uses HTTP/2 for transport and Protocol Buffers as the interface description language. It allows for efficient communication between services.

- Use Cases: Microservices architecture, high-performance applications, and inter-service communication.

  1. MQTT (Message Queuing Telemetry Transport)

Description: MQTT is a lightweight messaging protocol

designed for low-bandwidth, high-latency networks, often used in IoT applications. It uses a publish/subscribe model.

- Use Cases: IoT devices, remote monitoring, and real-time analytics.

Each of these API architecture styles has its strengths and weaknesses, making them suitable for different scenarios. The choice of which to use often depends on

:)

2 months ago

Python Collections
Python supports 4 types of collections:
List: Ordered, changeable, and allows duplicate members.
Tuple: Ordered, unchangeable, and allows duplicate members.
Set: Unordered, unchangeable, and does not allow duplicate members.
Dictionary: Ordered and changeable, but does not allow duplicate keys.
Set items are unchangeable, but you can add or remove items.
** Dictionaries are ordered as of Python 3.7. In earlier versions, they are unordered.
:)

2 months ago

Python3 Programming #post_14

ا لقوائم Python
ما هي القوائم (Lists)؟
القوائم هي طريقة لتخزين عناصر متعددة داخل متغير واحد. وهي واحدة من 4 أنواع بيانات مدمجة في Python تُستخدم لتخزين مجموعات من البيانات، بالإضافة إلى المجموعات الأخرى: Tuple وSet وDictionary، ولكل منها خصائص واستخدامات مختلفة.
إنشاء قائمة
يتم إنشاء القوائم باستخدام الأقواس المربعة:
مثال:
\# إنشاء قائمة thislist = ["apple", "banana", "cherry"] print(thislist)
خصائص القوائم
مرتبة (Ordered):
يعني أن العناصر لها ترتيب محدد لن يتغير.
عند إضافة عناصر جديدة، يتم وضعها في نهاية القائمة.
قابلة للتغيير (Changeable):
يمكنك تعديل العناصر، أو إضافة عناصر جديدة، أو حذفها بعد إنشاء القائمة.
تسمح بالتكرار (Allow Duplicates):
يمكن أن تحتوي القائمة على قيم مكررة لأن العناصر يتم فهرستها.
مثال:
\# قائمة تحتوي على عناصر مكررة thislist = ["apple", "banana", "cherry", "apple", "cherry"] print(thislist)
طول القائمة
يمكنك معرفة عدد العناصر في القائمة باستخدام دالة len():
مثال:
\# طباعة عدد العناصر في القائمة thislist = ["apple", "banana", "cherry"] print(len(thislist))
أنواع بيانات العناصر
يمكن أن تحتوي القائمة على عناصر من أنواع بيانات مختلفة، مثل النصوص والأرقام والقيم المنطقية.
مثال:
\# قوائم بأنواع بيانات مختلفة list1 = ["apple", "banana", "cherry"] \# نصوص list2 = [1, 5, 7, 9, 3] \# أرقام list3 = [True, False, False] \# قيم منطقية \# قائمة تحتوي على أنواع بيانات مختلفة list4 = ["abc", 34, True, 40, "male"]
التحقق من نوع البيانات
القوائم في Python هي كائنات من النوع list.
مثال:
\# التحقق من نوع البيانات mylist = ["apple", "banana", "cherry"] print(type(mylist))
إنشاء قائمة باستخدام المُنشئ list()
يمكنك أيضًا إنشاء قائمة باستخدام المُنشئ list().
مثال:
\# استخدام list() لإنشاء قائمة thislist = list(("apple", "banana", "cherry")) \# لاحظ الأقواس المزدوجة print(thislist)
مجموعات البيانات في Python
Python تدعم 4 أنواع من المجموعات:
List: مجموعة مرتبة وقابلة للتغيير. تسمح بالعناصر المكررة.
Tuple: مجموعة مرتبة وغير قابلة للتغيير. تسمح بالعناصر المكررة.
Set: مجموعة غير مرتبة وغير قابلة للتغيير، ولا تسمح بتكرار العناصر.
Dictionary: مجموعة مرتبة (بدءًا من الإصدار 3.7) وقابلة للتغيير. لا تسمح بتكرار المفاتيح.
Python Lists
What Are Lists?
Lists are used to store multiple items in a single variable. They are one of the 4 built-in data types in Python used for storing collections of data, alongside Tuple, Set, and Dictionary, each with distinct qualities and uses.
Creating a List
Lists are created using square brackets:
Example:
\# Create a list thislist = ["apple", "banana", "cherry"] print(thislist)
Properties of Lists
Ordered:
Items in a list have a defined order that will not change.
New items are added at the end of the list.
Changeable:
Lists can be modified by changing, adding, or removing items.
Allow Duplicates:
Lists can contain duplicate values since items are indexed.
Example:
\# A list with duplicate values thislist = ["apple", "banana", "cherry", "apple", "cherry"] print(thislist)
List Length
You can determine the number of items in a list using the len() function.
Example:
\# Print the number of items in the list thislist = ["apple", "banana", "cherry"] print(len(thislist))
Data Types in Lists
List items can be of any data type, including strings, integers, and booleans.
Example:
\# Lists with different data types list1 = ["apple", "banana", "cherry"] \# Strings list2 = [1, 5, 7, 9, 3] \# Numbers list3 = [True, False, False] \# Boolean values \# A list with mixed data types list4 = ["abc", 34, True, 40, "male"]
Checking Data Type
In Python, lists are objects of the data type list.
Example:
\# Check the data type of a list mylist = ["apple", "banana", "cherry"] print(type(mylist))
Creating Lists with the list() Constructor
You can also create a list using the list() constructor.
Example:
\# Using the list() constructor to create a list thislist = list(("apple", "banana", "cherry")) \# Note the double parentheses print(thislist)

3 months, 1 week ago

اتمنى الكل يستفيد??

3 months, 1 week ago

منور يا عبود

3 months, 1 week ago

لا تستخدمو chat gpt في المشاريع المعقدة..
Chat gpt لا تستخدموه في المشاريع المعقدة..
في المشاريع المعقدة لا تستخدمو chat gpt..

لانه بعد استعماله هيدخل في موضوع غير موضوعك الاساسي وانت م هتفهم شي بعده وتضيع مشروعك .. وشكرا??
:)

3 months, 1 week ago

مثال:

print(bool(False)) \# False print(bool(None)) \# False print(bool(0)) \# False print(bool("")) \# False print(bool(())) \# False print(bool([])) \# False print(bool({})) \# False

---

6. القيم المنطقية في الفئات (Classes)

يمكن لأي كائن (Object) أيضًا أن يقيم كـ False إذا كان مشتقاً من فئة تحتوي على دالة __len__ تعيد 0 أو False.

مثال:

```
class MyClass:
def __len__(self):
return 0

myobj = MyClass()
print(bool(myobj)) # False
```

---

7. الدوال التي تعيد قيمة منطقية

يمكنك إنشاء دوال تعيد قيمة منطقية.

مثال:

```
def myFunction():
return True

print(myFunction()) # True

if myFunction():
print("YES!")
else:
print("NO!")
```

---

8. دوال بايثون المدمجة التي تعيد قيم منطقية

يحتوي بايثون على عدة دوال مدمجة تعيد قيمًا منطقية، مثل isinstance().

مثال:

x = 200 print(isinstance(x, int)) \# True

---

:)

3 months, 1 week ago

Python3 Programming #post_12

---

Introduction to Python Booleans

In Python, Booleans are a simple data type that represent one of two values: True or False. They are useful for conditions, comparisons, and evaluating expressions.

---

1. Boolean Values

Booleans are helpful for determining if an expression is True or False. Python will return a Boolean answer when comparing two values.

Example:

print(10 > 9) \# True print(10 == 9) \# False print(10 < 9) \# False

---

2. Using Booleans in Conditional Statements

Booleans are especially useful in conditional statements, like if statements, where Python returns True or False based on the condition.

Example:

```
a = 200
b = 33

if b > a:
print("b is greater than a")
else:
print("b is not greater than a")
```

---

3. Evaluating Values and Variables with bool()

You can use the bool() function to evaluate any value and determine if it’s True or False.

Example:

```
print(bool("Hello")) # True
print(bool(15)) # True

x = "Hello"
y = 15
print(bool(x)) # True
print(bool(y)) # True
```

---

4. Most Values are True

Most non-empty values (like non-zero numbers, non-empty strings, and collections) evaluate to True.

Example:

print(bool("abc")) \# True print(bool(123)) \# True print(bool(["apple", "cherry", "banana"])) \# True

---

5. Values That Are False

Certain values, like empty strings (""), the number 0, empty collections, and None, Example:False.

Example:

print(bool(False)) \# False print(bool(None)) \# False print(bool(0)) \# False print(bool("")) \# False print(bool(())) \# False print(bool([])) \# False print(bool({})) \# False

---

6. Boolean in Custom Classes

An object can also evaluate to False if it’s made from a class that has a __len__ function returning 0 or False.

Example:

```
class MyClass:
def __len__(self):
return 0

myobj = MyClass()
print(bool(myobj)) # False
```

---

7. Functions Returning Boolean

You can create functionExample:n a Boolean value.

Example:

```
def myFunction():
return True

print(myFunction()) # True

if myFunction():
print("YES!")
else:
print("NO!")
```

---

8. Built-In Boolean Functions

Python has several built-in functions that retuExample: such as isinstance().

Example:

x = 200 print(isinstance(x, int)) \# True

---

### Python Booleans

---

مقدمة عن القيم المنطقية في بايثون

في بايثون، القيم المنطقية (Booleans) تمثل نوع بيانات بسيط يعبر عن حالتين فقط: True أو False. تستخدم القيم المنطقية في ال1. القيم المنطقيةم التعبيرات.

---

1. القيم المنطقية

تستخدم القيم المنطقية لتحديد ما إذا كان التعبير صحيحًا (True) أو خاطئًا (False). عند المقارنةمثال:ين، يعيد بايثون نتيجة منطقية.

مثال:

print(10 > 9) \# True print(10 == 9) \# False print(10 < 9) \# False

---

2. استخدام القيم المنطقية في العبارات الشرطية

تعتبر القيم المنطقية مفيدة خاصة في العبارات الشرطية مثل if، حيث مثال:ون True أو False بناءً على الشرط.

مثال:

```
a = 200
b = 33

if b > a:
print("b أكبر من a")
else:
print("b ليس أكبر من a")
```

---

3. تقييم القيم والمتغيرات باستخدام bool()

يمكنك استخدام دالة bool() لتمثال:يمة وتحديد ما إذا كانت True أو False.

مثال:

```
print(bool("Hello")) # True
print(bool(15)) # True

x = "Hello"
y = 15
print(bool(x)) # True
print(bool(y)) # True
```

---

4. معظم القيم تقيّم كـ True

تقريباً أي قيمة غير فارغة (مثل الأرقام غير الصفرية، السمثال:ية غير الفارغة، والمجموعات) تقيم كـ True.

مثال:

print(bool("abc")) \# True print(bool(123)) \# True print(bool(["apple", "cherry", "banana"])) \# True

---

5. القيم التي تعتبر False

هناك بعض القيم التي تقيم كـ False، مثل السلاسل النصية الفارغة ("")، الرقم 0، المجموعات الفارغة، وNone.

3 months, 1 week ago

Python3 Programming #post_11
### Python String Methods: A Guide for Beginners

In both English and Arabic, here’s a beginner-friendly summary of the most commonly used string methods in Python. These methods allow for easy manipulation of text data and are invaluable for anyone working with text processing.

---

Introduction to Python String Methods
Python provides a wide range of built-in methods to work with strings. These methods help you easily modify, analyze, and format text data in various ways. Remember, each method creates a new string and does not alter the original string.

---

Basic String Methods
Here’s a list of some commonly used string methods in Python and their descriptions:

  1. capitalize() - Converts the first character to uppercase.
  2. casefold() - Converts the string to lowercase, useful for case-insensitive comparisons.
  3. center(width) - Centers the string within a given width.
  4. count(substring) - Counts how many times a substring appears.
  5. encode() - Returns an encoded version of the string, useful for handling text in different character encodings.
  6. endswith(suffix) - Checks if the string ends with a specified suffix.

---

Formatting and Searching Methods
1. find(substring) - Finds the position of a substring in the string.
2. format() - Formats specified values within the string.
3. index(substring) - Similar to find but raises an error if not found.
4. isalnum() - Returns True if all characters are alphanumeric.
5. isalpha() - Returns True if all characters are alphabet letters.

---

Additional Useful Methods
1. join(iterable) - Joins elements in an iterable with the string as a separator.
2. replace(old, new) - Replaces occurrences of a substring with another.
3. split(separator) - Splits the string at a specified separator.
4. strip() - Removes whitespace from the start and end of the string.
5. upper() - Converts all characters to uppercase.

---

مقدمة حول أساليب التعامل مع النصوص في بايثون
يوفر بايثون مجموعة واسعة من الأساليب المدمجة التي تساعدك على التعامل مع النصوص بسهولة. هذه الأساليب تتيح لك تعديل وتحليل وتنسيق البيانات النصية بطرق مختلفة. تذكر أن كل أسلوب يُرجع نصًا جديدًا ولا يغيّر النص الأصلي.

---

أساليب النصوص الأساسية
إليك قائمة بأهم أساليب التعامل مع النصوص في بايثون ووصفها:

  1. capitalize() - تحويل أول حرف إلى حرف كبير.
  2. casefold() - تحويل النص إلى أحرف صغيرة بالكامل.
  3. center(width) - محاذاة النص في المنتصف بعرض معين.
  4. count(substring) - عدّ تكرار جزء من النص.
  5. encode() - إرجاع نسخة مشفرة من النص للتعامل مع تنسيقات الأحرف المختلفة.
  6. endswith(suffix) - التحقق مما إذا كان النص ينتهي بقيمة معينة.

---

أساليب التنسيق والبحث
1. find(substring) - البحث عن موضع جزء من النص.
2. format() - تنسيق قيم محددة داخل النص.
3. index(substring) - مشابهه لـ find لكن يظهر خطأ إذا لم يُعثر على الجزء.
4. isalnum() - يُرجع True إذا كانت كل الأحرف أبجدية أو أرقام.
5. isalpha() - يُرجع True إذا كانت كل الأحرف من الأبجدية.

---

أساليب إضافية مفيدة
1. join(iterable) - دمج العناصر في مجموعة باستخدام النص كمفصل.
2. replace(old, new) - استبدال جزء معين من النص بآخر.
3. split(separator) - تقسيم النص عند فاصل معين.
4. strip() - إزالة المسافات من بداية ونهاية النص.
5. upper() - تحويل كل الأحرف إلى أحرف كبيرة.

:)

3 months, 2 weeks ago

شباب كيف حالكم ان شاءالله بخير
اليوم نتكلم عن مواضوع مهم جدا جدا
حظر واتساب ?? المشكلة مؤثرة على معظم الاجهزة ومعظم الناس.. وللاسف الحل معقد جدا غالبا م يتم حل المشكلة ويكون المستخدم زهج..
المهم الحظر ليه اسباب كثيرة جدا اولا في الفترة الاخيرة لاحظنا تواجد عدد كبير من عمليات الاحتيال و scams وغيرها وللاسف ناس كثيرة وقعت ضحيتها ..
شركة واتساب تقوم بمعاينة اي رسالة. وعندها عدة تصنيفات للرسائل فاذا تم تصنيف رسالتك ك scam تقوم الشركة مباشرة بحظر حسابك ..
طيب كيف يكون تصنيف رسالتك ك scam في الفترة الاخيرة ظهور بوتات ومواقع وتطبيقات تجعل المستخدم يقوم بمهام مقابل جوائز مالية ومن ضمن المهم ما يعرف بالاحالات طيب الروابط الي تقوم بنسخها وارسالها لكل متابعينك ليقومو بعمل احالات ليك معظم الروابط يتم تصنيفها في بعض التطبيقات كروابط خبية فيقوم الواتساب مباشرة بحظرك ..
وفي انواع اخرى من الرسائل الخبيثة ممكن في شكل صور او فيدو او غيره فرجاء ابتعدو منها لعدم التضرر وغالبا يقومو صاحب الرباط باختراق حسابك والاسواء انه يقوم بالنصب عليك
حاولو تجنب هذه الأشياء بالءات في تطبيق واتساب
:)

We recommend to visit

Official Telegram Channel by Sarkari Result SarkariResult.Com
Welcome to this official Channel of Sarkari Result SarkariResult.Com - On this page you will get all the updated information on Sarkari Result website from time to time.

Last updated 1 week, 4 days ago

?Only Current Affairs English & Hindi Medium.
Contact @GKGSAdminBot
Channel Link- https://t.me/+wytqxfcVInNjN2E1

By Chandan Kr Sah
Email- [email protected]

Must Subscribe Us On YouTube - https://youtube.com/channel/UCuxj11YwYKYRJSgtfYJbKiw

Last updated 1 year, 10 months ago

✆ Contact ? @Aarav723

#UPSC, #SSC , #CGL #BPSC #STATE #PET #Banking, #Railway, #Mppsc, #RRB, #IBPS, #Defence, #Police, #RBI etc.

??This Channel Has Been Established With The Aim Of Providing Proper Guidance To Youths Preparing For All Govt Exam

Last updated 2 months ago