<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Praneeth</title>
    <description>The latest articles on DEV Community by Praneeth (@praneeth_647b9830399cd2b7).</description>
    <link>https://dev.to/praneeth_647b9830399cd2b7</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2475937%2Fea8902e1-63c8-4d85-9b33-b4ea700293bc.jpg</url>
      <title>DEV Community: Praneeth</title>
      <link>https://dev.to/praneeth_647b9830399cd2b7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/praneeth_647b9830399cd2b7"/>
    <language>en</language>
    <item>
      <title>Day 5: Python Lists Demystified: Tips, Tricks, and Best Practices</title>
      <dc:creator>Praneeth</dc:creator>
      <pubDate>Tue, 21 Jan 2025 06:29:38 +0000</pubDate>
      <link>https://dev.to/praneeth_647b9830399cd2b7/day-5-python-lists-demystified-tips-tricks-and-best-practices-4mn3</link>
      <guid>https://dev.to/praneeth_647b9830399cd2b7/day-5-python-lists-demystified-tips-tricks-and-best-practices-4mn3</guid>
      <description>&lt;p&gt;A list is a built-in data structure that represents an ordered, mutable and indexable collection of items. It is similar to the arrays in c. but in the case of lists, they can be dynamically allocated.&lt;br&gt;
In python, the list is represented with &lt;a href="https://dev.tosquare%20brackets"&gt;&lt;/a&gt; with values separated by ",".&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = [1, 2, 3, 4, 5, 6]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Dynamically Allocated:&lt;/strong&gt; a data structure can grow (or shrink) in memory as needed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mutable:&lt;/strong&gt;  An object can be modified after it has been created.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Indexability:&lt;/strong&gt; the ability of a data structure to allow access to its elements using an index.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcgjxixa1t5982xt2krzk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcgjxixa1t5982xt2krzk.jpg" alt="Image description" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  List Assignment:
&lt;/h3&gt;

&lt;p&gt;There are two main scenarios to consider: direct assignment and copying.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Direct Assignment
&lt;/h4&gt;

&lt;p&gt;When you directly assign one list to another variable, both variables point to the same list object in memory. Changes made via one variable will affect the other.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = [1 , 2 , 3 , 4]
b = a
b[3] = 10
print(b) #[1,2,3,10]
print(a) #[1,2,3,10]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2.Copying a List
&lt;/h4&gt;

&lt;p&gt;To create an independent copy of a list, you need to explicitly copy it using methods like:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Using List():&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;list2 = list(list1)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Using copy():&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;List2 = List1.copy()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  List Slicing:
&lt;/h3&gt;

&lt;p&gt;List slicing is a technique used to extract a subset of elements from a list. It allows you to create a new list that includes a specific range of elements from an existing list.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;syntax&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;List2 = List1[start : stop : step] 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;c = [10, 2, 3, 4]
d = c[0 : 3 : 1]
print(d) ##[10, 2, 3]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Nested Lists:
&lt;/h3&gt;

&lt;p&gt;In python, a List can consist of another lists as elements&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;list1 = [[1,2,3,4],[5,6,7,8]]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Built-In Functions:
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. append()
&lt;/h4&gt;

&lt;p&gt;Adds an element to the end of the list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;List1 = [1, 2, 3]
List1.append(4)
print(List1)  #[1, 2, 3, 4]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. pop()
&lt;/h4&gt;

&lt;p&gt;Removes and returns an element at a specific index (defaults to the last element).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_list = [1, 2, 3]
removed_element = my_list.pop()
print(removed_element)  # 3
print(my_list)  #[1, 2]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  3. remove()
&lt;/h4&gt;

&lt;p&gt;Removes the first occurrence of a specific element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_list = [1, 2, 3, 2]
my_list.remove(2)
print(my_list)  # [1, 3, 2]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  4. clear()
&lt;/h4&gt;

&lt;p&gt;Removes all elements from the list, making it empty.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_list = [1, 2, 3]
my_list.clear()
print(my_list)  # Output: []
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  5. index()
&lt;/h4&gt;

&lt;p&gt;Returns the index of the first occurrence of a specified element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_list = [1, 2, 3]
print(my_list.index(2))  # Output: 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  6. count()
&lt;/h4&gt;

&lt;p&gt;Returns the number of occurrences of a specified element in the list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_list = [1, 2, 2, 3, 2]
print(my_list.count(2))  # Output: 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  7. sort()
&lt;/h4&gt;

&lt;p&gt;Sorts the elements of the list in ascending order (modifies the list in place).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_list = [3, 1, 2]
my_list.sort()
print(my_list)  # Output: [1, 2, 3]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  8. reverse()
&lt;/h4&gt;

&lt;p&gt;Reverses the order of the elements in the list (modifies the list in place).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_list = [1, 2, 3]
my_list.reverse()
print(my_list)  # Output: [3, 2, 1]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  9. min() and max()
&lt;/h4&gt;

&lt;p&gt;min() returns the smallest element in the list.&lt;br&gt;
max() returns the largest element in the list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_list = [1, 2, 3, 4]
print(min(my_list))  # Output: 1
print(max(my_list))  # Output: 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  10. sum()
&lt;/h4&gt;

&lt;p&gt;Returns the sum of all elements in the list (useful for lists of numbers).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_list = [1, 2, 3, 4]
print(sum(my_list))  # Output: 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Day 4 :Everything You Need to Know About Functions in Python</title>
      <dc:creator>Praneeth</dc:creator>
      <pubDate>Wed, 08 Jan 2025 12:27:53 +0000</pubDate>
      <link>https://dev.to/praneeth_647b9830399cd2b7/day-4-everything-you-need-to-know-about-functions-in-python-4hnl</link>
      <guid>https://dev.to/praneeth_647b9830399cd2b7/day-4-everything-you-need-to-know-about-functions-in-python-4hnl</guid>
      <description>&lt;h2&gt;
  
  
  Definition and Defining Functions
&lt;/h2&gt;

&lt;p&gt;A function represents some part of the code which can be executed only when required .In python, user defines the function by using &lt;strong&gt;&lt;em&gt;def&lt;/em&gt;&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def sum(a,b):
  print(a+b)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in this example we have performed a sum of two integers a,b. so.. whenever we require to sum two numbers, we can directly use the function &lt;strong&gt;sum(a,b)&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calling a Function
&lt;/h2&gt;

&lt;p&gt;In Python, calling a function means executing the code defined inside a function block by using the function's name followed by parentheses. Here is an example for how calling is done in python:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def sum(a,b):
  print(a+b)

sum(1,3)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;here,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;a&lt;/strong&gt; and &lt;strong&gt;b&lt;/strong&gt; are the parameters in the function definition.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;1&lt;/strong&gt;, &lt;strong&gt;3&lt;/strong&gt; are the arguments passed to the function.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;sum&lt;/strong&gt; is the name of the function&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Generally, there are 4 types of Arguments:&lt;/p&gt;

&lt;h3&gt;
  
  
  1.Required Arguments
&lt;/h3&gt;

&lt;p&gt;Required arguments are the parameters that a function must receive when it is called. If you do not provide the required arguments in a function call, Python will raise a &lt;code&gt;TypeError&lt;/code&gt; because the function will not have the necessary information to execute.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sum(a,b):
  print(a+b)
sum(1,3)

sum()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt; &lt;code&gt;4&lt;/code&gt;&lt;br&gt;
TypeError&lt;/p&gt;

&lt;p&gt;Here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; are required arguments because they do not have a default value.&lt;/li&gt;
&lt;li&gt;So, when you call &lt;code&gt;sum&lt;/code&gt; without an argument, Python raises an error.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  2. Keyword Arguments
&lt;/h3&gt;

&lt;p&gt;Keyword arguments allow you to pass arguments to a function by explicitly specifying the parameter names.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;new_print(a,b):
   print("{a} is a friend of {b}")
new_print(b="Alice" ,a="Bob")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt; &lt;code&gt;Bob is a friend of Alice&lt;/code&gt;&lt;br&gt;
Here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Since the Arguments are mentioned beforehand, in spite of wrong order, this code will produce this kind of result.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  3. Default Arguments
&lt;/h3&gt;

&lt;p&gt;Default arguments in Python allow you to define a function with default values for certain parameters. If a value for a parameter with a default is not provided during the function call, Python automatically assigns the default value. This makes functions more flexible and reduces the need to specify every parameter explicitly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sum(a=0, b=0):
   print(a+b)
sum()
sum(1,3)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt; &lt;code&gt;0\n 4&lt;/code&gt;&lt;br&gt;
In this example, even though, we have not assigned any variable to a, b since the a and b are assigned to a default value, it will give an output &lt;code&gt;0&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  4. Variable Length Arguments
&lt;/h3&gt;

&lt;p&gt;Python provides a way to define functions that can accept a variable number of arguments. Variable-length arguments are handled using:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;*args (for non-keyword arguments)&lt;/li&gt;
&lt;li&gt;**kwargs (for keyword arguments)&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;
  
  
  1. *args:
&lt;/h4&gt;

&lt;p&gt;*args allows a function to accept any number of positional arguments. Inside the function, these arguments are accessible as a tuple.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sum (*numbers):
   sum=0
   for i in numbers:
     sum+=i
   print(sum)
sum(1,2,3,4)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt; &lt;code&gt;10&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  2. **Kwargs:
&lt;/h4&gt;

&lt;p&gt;**kwargs allows a function to accept any number of keyword arguments (arguments passed as key=value pairs). These are stored in a dictionary.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sum(**numbers):
  sum=0
  for keys,values in numbers:
     print("{keys}={numbers}")
     sum+= values
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  💡Trick of the Day: 4 ways to swap the numbers
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;way 1:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;P=5
Q=4
temp = P  
P = Q  
Q = temp 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;way 2:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;P=5
Q=4
P,Q=Q,P
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;way 3:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;P=5
Q=4
P = P ^ Q  
Q = P ^ Q  
P = P ^ Q
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;way 4:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;P=5
Q=4
P = P + Q    
Q = P - Q   
P = P - Q 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>competativeprogramming</category>
    </item>
    <item>
      <title>Day 3: Mastering the Art of Conditional Statements and Loops</title>
      <dc:creator>Praneeth</dc:creator>
      <pubDate>Thu, 02 Jan 2025 16:34:31 +0000</pubDate>
      <link>https://dev.to/praneeth_647b9830399cd2b7/day-3-mastering-the-art-of-conditional-statements-and-loops-1ihp</link>
      <guid>https://dev.to/praneeth_647b9830399cd2b7/day-3-mastering-the-art-of-conditional-statements-and-loops-1ihp</guid>
      <description>&lt;h2&gt;
  
  
  Conditional Statements
&lt;/h2&gt;

&lt;p&gt;Like other programming languages, Python also includes conditional statements. But the only difference is that instead of &lt;em&gt;&lt;strong&gt;else if&lt;/strong&gt;&lt;/em&gt;, we have &lt;em&gt;&lt;strong&gt;elif&lt;/strong&gt;&lt;/em&gt;.&lt;br&gt;
Conditional statements control the flow of a program based on specific conditions. They enable decision-making by allowing the program to execute different blocks of code depending on whether a condition evaluates to True or False.&lt;br&gt;
instead of explaining the &lt;em&gt;&lt;strong&gt;if&lt;/strong&gt;&lt;/em&gt;,&lt;em&gt;&lt;strong&gt;elif&lt;/strong&gt;&lt;/em&gt; and &lt;em&gt;&lt;strong&gt;else&lt;/strong&gt;&lt;/em&gt; individually let us cover them all in a single example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if a%2==0:
   print("The Number is an Even Composite")
elif not_prime(a):
   print("The Number is an Odd Composite")
else:
   print("The Number is a Prime")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;here, let the number be 3.&lt;br&gt;
First the program will check whether the number is divisible by 2 (&lt;code&gt;if a%2==0&lt;/code&gt;)&lt;br&gt;
since it is not even, it goes to elif satement(&lt;code&gt;if not_prime(a)&lt;/code&gt;)&lt;br&gt;
since neither the &lt;em&gt;&lt;strong&gt;if&lt;/strong&gt;&lt;/em&gt;, nor the &lt;em&gt;&lt;strong&gt;elif&lt;/strong&gt;&lt;/em&gt; are not true, the program will go to the &lt;em&gt;&lt;strong&gt;else&lt;/strong&gt;&lt;/em&gt; part and it will print:&lt;br&gt;
&lt;em&gt;The Number is a Prime&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Key Features:
&lt;/h3&gt;
&lt;h4&gt;
  
  
  1. Logical Operators for Conditions
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;age=19
if age&amp;gt;18 and age&amp;lt;25:
   print("the person is an Young Adult")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  2. Nested Conditional Statements
&lt;/h4&gt;

&lt;p&gt;You can nest conditional statements within one another to evaluate complex conditions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;age = 20
if age &amp;gt;= 18:
    if age &amp;lt; 25:
        print("You are a young adult.")
    else:
        print("You are an adult.")
else:
    print("You are not an adult yet.")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  3. Ternary Conditional Statements
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bob_score=87
alen_score=92
answer=bob_score if bob_score&amp;gt;alen_score else alen_score
print(answer)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt;&lt;code&gt;92&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  💡 Trick of the Day:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;startswith() and endswith()&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The startswith() and endswith() are string methods that return
True if a specified string starts with or ends with a specified
value.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Let’s say you want to return all the names in a list that starts with&lt;br&gt;
"a." &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;here is how you would use startswith() to accomplish that.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Using startswith():&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;listl = ['lemon','Orange','apple', 'apricot']
new_list = [i for i in listl if i.startswith('a')]
pri nt(new_li st)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt; &lt;code&gt;['apple', 'apricot']&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Using endwith():&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
listl = ['lemon','Orange','apple', 'apricot']
new_list = [i for i in listl if i.endswith('e')]]
pri nt(new_li st)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt; &lt;code&gt;['apple', 'Orange']&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Loops
&lt;/h2&gt;

&lt;p&gt;In Addition to decision-making statements, Python programming also supports looping statements. There are &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. while&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;2. for&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  1. For Loop:
&lt;/h3&gt;

&lt;p&gt;The for loop in Python iterates over a sequence (such as a list, tuple, string, or range) and performs an operation for each item in that sequence.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a=[1,2,3,4]
for i in a:
   print(a)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt; &lt;code&gt;0\n 1\n 2\n 3\n 4\n&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here, the for loop iterates through all the elements in the list a and prints them.&lt;br&gt;
&lt;strong&gt;Using range() with for:&lt;/strong&gt;&lt;br&gt;
You can use the range() function to generate a sequence of numbers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for i in range(4):
    print(i)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt; &lt;code&gt;0\n 1 \n 2\n 3\n&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Range():&lt;/strong&gt;&lt;br&gt;
The basic syntax of the range() function is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;range(start, end, steps) 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;here &lt;code&gt;start=0&lt;/code&gt; and &lt;code&gt;step=1&lt;/code&gt; by default.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for i range(1,3):
   print(i)
for j range(1,4,2):
   print(j)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;code&gt;Answer:1\n 2\n&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
          &lt;strong&gt;&lt;code&gt;1\n 3\n&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  While Loop:
&lt;/h3&gt;

&lt;p&gt;The while loop continues to execute the block of code as long as the condition evaluates to True.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;number=4
while(number!=0):
   print(number)
   number--
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt; &lt;code&gt;4\n 3\n 2\n 1\n&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. break Statement
&lt;/h3&gt;

&lt;p&gt;The break statement is used to terminate a loop prematurely, regardless of its condition. Once the break statement is executed, the control exits the loop.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for i in range(10):
    if i == 5:
        break  # Exit the loop when i equals 5
    print(i)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt; &lt;code&gt;10\n 9\n 8\n 7\n 6\n&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. continue Statement
&lt;/h3&gt;

&lt;p&gt;The continue statement is used to skip the rest of the code in the current iteration and proceed to the next iteration of the loop.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for i in range(10):
   if i%2==0:
     continue
   print(i)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt; &lt;code&gt;1\n 3\n 5\n 7\n 9\n&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. pass Statement
&lt;/h2&gt;

&lt;p&gt;The pass statement is a placeholder used when a block of code is syntactically required but you don't want to execute any code. It literally does nothing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for i in range(5):
    if i == 3:
        pass  # Do nothing when i equals 3
    else:
        print(i)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt; &lt;code&gt;0\n 1\n 2\n 4\n&lt;/code&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>programming</category>
    </item>
    <item>
      <title>Day -2 : Mastering basics of Python</title>
      <dc:creator>Praneeth</dc:creator>
      <pubDate>Tue, 03 Dec 2024 17:11:00 +0000</pubDate>
      <link>https://dev.to/praneeth_647b9830399cd2b7/day-2-mastering-basics-of-python-4ama</link>
      <guid>https://dev.to/praneeth_647b9830399cd2b7/day-2-mastering-basics-of-python-4ama</guid>
      <description>&lt;h2&gt;
  
  
  Operators in python
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Arithmetic Operators
&lt;/h3&gt;

&lt;p&gt;Used for basic mathematical calculations.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;+&lt;/code&gt; (Addition):&lt;/strong&gt; Adds two numbers.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;5 + 3 → 8&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;-&lt;/code&gt; (Subtraction):&lt;/strong&gt; Subtracts the second number from the first.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;5 - 3 → 2&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;*&lt;/code&gt; (Multiplication):&lt;/strong&gt; Multiplies two numbers.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;5 * 3 → 15&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;/&lt;/code&gt; (Division):&lt;/strong&gt; Divides the first number by the second, returning a float.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;5 / 2 → 2.5&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;//&lt;/code&gt; (Floor Division):&lt;/strong&gt; Divides and rounds down to the nearest integer.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;5 // 2 → 2&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;%&lt;/code&gt; (Modulus):&lt;/strong&gt; Returns the remainder of the division.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;5 % 2 → 1&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;`&lt;/strong&gt;&lt;code&gt; (Exponentiation):** Raises the first number to the power of the second.  &lt;br&gt;
Example: &lt;/code&gt;5 ** 2 → 25`&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Arithmetic Operators
&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Addition:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;        &lt;span class="c1"&gt;# 13
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Subtraction:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="c1"&gt;# 7
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Multiplication:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 30
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Division:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;        &lt;span class="c1"&gt;# 3.333...
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Floor Division:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# 3
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Modulus:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;         &lt;span class="c1"&gt;# 1
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Exponentiation:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# 1000
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  2. Assignment Operators
&lt;/h3&gt;

&lt;p&gt;Used to assign values to variables.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;=&lt;/code&gt; (Assign):&lt;/strong&gt; Assigns a value to a variable.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;x = 5&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;+=&lt;/code&gt; (Add and Assign):&lt;/strong&gt; Adds a value and reassigns.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;x += 3 → x = x + 3&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;-=&lt;/code&gt; (Subtract and Assign):&lt;/strong&gt; Subtracts a value and reassigns.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;x -= 3 → x = x - 3&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;*=&lt;/code&gt; (Multiply and Assign):&lt;/strong&gt; Multiplies a value and reassigns.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;x *= 3 → x = x * 3&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;/=&lt;/code&gt; (Divide and Assign):&lt;/strong&gt; Divides a value and reassigns.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;x /= 3 → x = x / 3&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;//=&lt;/code&gt; (Floor Divide and Assign):&lt;/strong&gt; Floor divides and reassigns.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;x //= 3 → x = x // 3&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;%=&lt;/code&gt; (Modulus and Assign):&lt;/strong&gt; Applies modulus and reassigns.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;x %= 3 → x = x % 3&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;`&lt;/strong&gt;=&lt;code&gt; (Exponentiate and Assign):** Raises to a power and reassigns.  &lt;br&gt;
Example: &lt;/code&gt;x *&lt;em&gt;= 2 → x = x *&lt;/em&gt; 2`&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Assignment Operators
&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Initial value:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;       &lt;span class="c1"&gt;# 5
&lt;/span&gt;
&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;After += 3:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# 8
&lt;/span&gt;
&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;After -= 2:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# 6
&lt;/span&gt;
&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;After *= 4:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# 24
&lt;/span&gt;
&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;After /= 3:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# 8.0
&lt;/span&gt;
&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;//=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;After //= 2:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;         &lt;span class="c1"&gt;# 4.0
&lt;/span&gt;
&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;%=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;After %= 3:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# 1.0
&lt;/span&gt;
&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;**=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;After **= 2:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;         &lt;span class="c1"&gt;# 1.0
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  3. Comparison Operators
&lt;/h3&gt;

&lt;p&gt;Used to compare two values.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;==&lt;/code&gt; (Equal to):&lt;/strong&gt; Checks if two values are equal.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;5 == 5 → True&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;!=&lt;/code&gt; (Not Equal to):&lt;/strong&gt; Checks if two values are not equal.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;5 != 3 → True&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;&amp;gt;&lt;/code&gt; (Greater than):&lt;/strong&gt; Checks if the first value is greater than the second.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;5 &amp;gt; 3 → True&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;&amp;lt;&lt;/code&gt; (Less than):&lt;/strong&gt; Checks if the first value is less than the second.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;3 &amp;lt; 5 → True&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;&amp;gt;=&lt;/code&gt; (Greater than or Equal to):&lt;/strong&gt; Checks if the first value is greater than or equal to the second.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;5 &amp;gt;= 5 → True&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;&amp;lt;=&lt;/code&gt; (Less than or Equal to):&lt;/strong&gt; Checks if the first value is less than or equal to the second.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;3 &amp;lt;= 5 → True&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Comparison Operators
&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Equal:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# False
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Not Equal:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="c1"&gt;# True
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Greater than:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c1"&gt;# True
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Less than:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;       &lt;span class="c1"&gt;# False
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Greater or Equal:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# True
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Less or Equal:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# False
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  4. Logical Operators
&lt;/h3&gt;

&lt;p&gt;Used for combining conditions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;and&lt;/code&gt;:&lt;/strong&gt; Returns &lt;code&gt;True&lt;/code&gt; if both conditions are true.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;(5 &amp;gt; 3) and (4 &amp;gt; 2) → True&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;or&lt;/code&gt;:&lt;/strong&gt; Returns &lt;code&gt;True&lt;/code&gt; if at least one condition is true.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;(5 &amp;gt; 3) or (2 &amp;gt; 4) → True&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;not&lt;/code&gt;:&lt;/strong&gt; Reverses the truth value.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;not(5 &amp;gt; 3) → False&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Logical Operators
&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;AND:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;           &lt;span class="c1"&gt;# False
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OR:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;             &lt;span class="c1"&gt;# True
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;NOT a:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;           &lt;span class="c1"&gt;# False
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;NOT b:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;           &lt;span class="c1"&gt;# True
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  5. Bitwise Operators
&lt;/h3&gt;

&lt;p&gt;Operate on binary representations of numbers.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;&amp;amp;&lt;/code&gt;:&lt;/strong&gt; Performs bitwise AND.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;5 &amp;amp; 3 → 1&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;|&lt;/code&gt;:&lt;/strong&gt; Performs bitwise OR.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;5 | 3 → 7&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;^&lt;/code&gt;:&lt;/strong&gt; Performs bitwise XOR.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;5 ^ 3 → 6&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;~&lt;/code&gt;:&lt;/strong&gt; Performs bitwise NOT.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;~5 → -6&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt;:&lt;/strong&gt; Shifts bits to the left.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;5 &amp;lt;&amp;lt; 1 → 10&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt;:&lt;/strong&gt; Shifts bits to the right.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;5 &amp;gt;&amp;gt; 1 → 2&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Bitwise Operators
&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;  &lt;span class="c1"&gt;# Binary: 0101
&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;  &lt;span class="c1"&gt;# Binary: 0011
&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bitwise AND:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="c1"&gt;# 1 (Binary: 0001)
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bitwise OR:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="c1"&gt;# 7 (Binary: 0111)
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bitwise XOR:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="c1"&gt;# 6 (Binary: 0110)
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bitwise NOT (~a):&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# -6
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Left Shift:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="c1"&gt;# 10 (Binary: 1010)
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Right Shift:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;    &lt;span class="c1"&gt;# 2 (Binary: 0010)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  6. Membership Operators
&lt;/h3&gt;

&lt;p&gt;Check if a value is present in a sequence.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;in&lt;/code&gt;:&lt;/strong&gt; Returns &lt;code&gt;True&lt;/code&gt; if the value is in the sequence.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;'a' in 'apple' → True&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;not in&lt;/code&gt;:&lt;/strong&gt; Returns &lt;code&gt;True&lt;/code&gt; if the value is not in the sequence.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;'z' not in 'apple' → True&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Membership Operators
&lt;/span&gt;&lt;span class="n"&gt;sequence&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3 in sequence:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;sequence&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;       &lt;span class="c1"&gt;# True
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;6 in sequence:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;sequence&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;       &lt;span class="c1"&gt;# False
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;6 not in sequence:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;sequence&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# True
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  7. Identity Operators
&lt;/h3&gt;

&lt;p&gt;Check if two variables reference the same object.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;is&lt;/code&gt;:&lt;/strong&gt; Returns &lt;code&gt;True&lt;/code&gt; if two variables point to the same object.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;x is y&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;is not&lt;/code&gt;:&lt;/strong&gt; Returns &lt;code&gt;True&lt;/code&gt; if two variables point to different objects.&lt;br&gt;&lt;br&gt;
Example: &lt;code&gt;x is not y&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Identity Operators
&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;
&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;a is b:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;         &lt;span class="c1"&gt;# True (same object)
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;a is c:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;         &lt;span class="c1"&gt;# False (different objects)
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;a is not c:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# True
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  8. Ternary Operator
&lt;/h3&gt;

&lt;p&gt;The ternary operator allows a shorthand for &lt;code&gt;if-else&lt;/code&gt; statements.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Ternary Operator
&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;

&lt;span class="n"&gt;max_value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Maximum value:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;max_value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 20
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  9. Walrus Operator (:=)
&lt;/h3&gt;

&lt;p&gt;Introduced in Python 3.8, the walrus operator allows assignment inside expressions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Walrus Operator (Python 3.8+)
&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="nf"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Length is greater than 3:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# 5
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  10. Enumerate with Loops
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;enumerate()&lt;/code&gt; function returns both the index and the value of each item in an iterable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Enumerate with Loops
&lt;/span&gt;&lt;span class="n"&gt;colors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;red&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;green&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;blue&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






</description>
    </item>
    <item>
      <title>Day 1: Mastering the Basics of Python</title>
      <dc:creator>Praneeth</dc:creator>
      <pubDate>Sun, 01 Dec 2024 19:06:37 +0000</pubDate>
      <link>https://dev.to/praneeth_647b9830399cd2b7/day-1-mastering-the-basics-of-python-10mp</link>
      <guid>https://dev.to/praneeth_647b9830399cd2b7/day-1-mastering-the-basics-of-python-10mp</guid>
      <description>&lt;p&gt;For the sake of simplicity, I am dividing this into 3 parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Variable Declaration&lt;/li&gt;
&lt;li&gt;Taking input and Declaring Output&lt;/li&gt;
&lt;li&gt;Operators and Expressions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  1.Variable Declaration
&lt;/h2&gt;

&lt;p&gt;Unlike other programming languages like c, cpp and java ,you don’t need to declare the type of a variable explicitly. This feature is called &lt;strong&gt;Dynamic Typing&lt;/strong&gt;.&lt;br&gt;
in C,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int a = 6;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;here, the variable is declared as integer.&lt;/p&gt;

&lt;p&gt;but in Python,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and the variable &lt;strong&gt;a&lt;/strong&gt; can be redeclared as&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = "hello world"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;🖋️NOTE:&lt;/strong&gt;&lt;br&gt;
Variable names are &lt;strong&gt;case-sensitive&lt;/strong&gt;., so a and A are considered different variables.&lt;/p&gt;
&lt;h3&gt;
  
  
  ✨ Features and Rules In Declaration
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Variable names must begin with an alphabet or an underscore (_)
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 6    #valid
_a = 6   #valid
-a = 6   #invalid
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;The "_" variable stores the result of the last expression in interactive Python mode. This can be visible in Jupiter Notebook
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 5
b = 6
a + b     #11
print(_)  #11 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;In python, multiple variables can be declared in one line
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a, b, c = 5, 6, 7
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Use the &lt;code&gt;global&lt;/code&gt; keyword to modify a global variable inside a function
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;global x

def print():
  return x   #there will be no error
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Unlike c and cpp ,Python does not have a built-in way to declare constants. By convention, variable names in all caps are treated as constants.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PI=3.14
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  2.Taking input and Declaring Output
&lt;/h2&gt;
&lt;h3&gt;
  
  
  &lt;em&gt;print()&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;The print() function is a built-in Python function used to display output to the console.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a=10000
print("hello world")   #hello world
print("hello", "world")#hello world
print("hello world",a) #hello world 10000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In print function, there are two main parameters.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;sep&lt;/strong&gt;  : It determines how multiple objects are separated when printed. It is usually preset to " ".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;end&lt;/strong&gt;  :  It defines what is printed at the end of the output.It is usually preset to "\n".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4sn2kjw97qa6hbpmwt2e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4sn2kjw97qa6hbpmwt2e.png" alt="print documentation" width="415" height="25"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print("hello world")
print("hi")    # hello world
               # hi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print("hello", "world", sep="-", end = " ")
print("hi")    # hello-world hi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;for the complete documentation of &lt;em&gt;print&lt;/em&gt;, &lt;a href="https://docs.python.org/3/library/functions.html#print" rel="noopener noreferrer"&gt;click here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  ✨ Features of &lt;em&gt;Print()&lt;/em&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;You can use escape sequences (e.g., &lt;em&gt;\n&lt;/em&gt; for a newline, &lt;em&gt;\t&lt;/em&gt; for a tab, and _\_ for a backslash) to include special characters in the printed output.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print("hello\nworld")   #hello
                        #world
print("hello\tworld")   #hello   world
print("happy\\trecking")#happy\trecking
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;print()&lt;/em&gt; is often used for debugging and tracing code execution because it provides a quick way to output variable values and program state.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = 5
y = 10
print(f"x: {x}, y: {y}") # x: 5, y: 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;em&gt;input()&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;em&gt;input()&lt;/em&gt; function in Python is used to take user input from the console.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name = input("Enter your age: ")
print("your age is: ",name)
# If the user enters 18, the output will be: "your age is 18"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🖋️&lt;strong&gt;NOTE&lt;/strong&gt;: &lt;br&gt;
By default, &lt;em&gt;input()&lt;/em&gt; returns a string, so if you need to use the input as a different type (e.g., int, float), you need to convert it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a =input("enter your age: )
type(a)                            #str
a=int(input("enter your age: ))
type(a)                            #int
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;In the upcoming blog, we'll delve into Python operators and conditional statements. Happy Learning&lt;/em&gt;😊😊😊&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>programming</category>
    </item>
    <item>
      <title>A New Blog Series: Python for AI Basics</title>
      <dc:creator>Praneeth</dc:creator>
      <pubDate>Fri, 29 Nov 2024 18:42:22 +0000</pubDate>
      <link>https://dev.to/praneeth_647b9830399cd2b7/a-new-blog-series-python-for-ai-basics-1jfj</link>
      <guid>https://dev.to/praneeth_647b9830399cd2b7/a-new-blog-series-python-for-ai-basics-1jfj</guid>
      <description>&lt;p&gt;Welcome to my new blog series, where we will explore the fascinating world of Python in the context of machine learning. Python has become a cornerstone in the field of data science and machine learning due to its simplicity and the powerful libraries it offers. Whether you're a beginner or looking to refine your skills, this series will guide you through the essentials of Python, setting a solid foundation for your machine learning journey.&lt;/p&gt;

&lt;h3&gt;
  
  
  Series Roadmap
&lt;/h3&gt;

&lt;p&gt;Here's what you can expect over the next 15 days:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Basics of Python&lt;/li&gt;
&lt;li&gt;Operators in Python&lt;/li&gt;
&lt;li&gt;Conditional and Iterating Statements&lt;/li&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;li&gt;Different Data Types&lt;/li&gt;
&lt;li&gt;OOP and Classes&lt;/li&gt;
&lt;li&gt;File Handling&lt;/li&gt;
&lt;li&gt;Numpy&lt;/li&gt;
&lt;li&gt;Pandas&lt;/li&gt;
&lt;li&gt;Matplotlib&lt;/li&gt;
&lt;li&gt;Seaborn&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each topic will be covered in detail, with examples and exercises to reinforce your learning. By the end of this series, you'll have a comprehensive understanding of Python's capabilities in machine learning. Stay tuned for the first post, and let's embark on this learning journey together!&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>A Beginner's Guide to Exploring Machine Learning in 2025</title>
      <dc:creator>Praneeth</dc:creator>
      <pubDate>Mon, 25 Nov 2024 21:15:49 +0000</pubDate>
      <link>https://dev.to/praneeth_647b9830399cd2b7/a-beginners-guide-to-exploring-machine-learning-in-2025-411m</link>
      <guid>https://dev.to/praneeth_647b9830399cd2b7/a-beginners-guide-to-exploring-machine-learning-in-2025-411m</guid>
      <description>&lt;p&gt;After six months of learning Machine Learning, I have encountered issues many beginners face. Here is some advice on how to tackle them effectively.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Learning Python
&lt;/h3&gt;

&lt;p&gt;I've noticed many of my friends weren't initially good at Python but started learning Artificial Intelligence. Python is essential for Machine Learning, and without it, implementation becomes challenging. It’s a good idea  to understand the basics of Python, including loops, conditional statements, functions, data types, and classes, for a better grasp. Learning these basics typically takes about 10-15 days. Libraries like NumPy, Pandas, and scikit-learn can be learned along the way.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Learning From Different Sources
&lt;/h3&gt;

&lt;p&gt;Another common mistake people make is referring to different sites and notes during the early days of learning ML. What i recommend is to either take a paid course over the Internet or stick to a single source throughout. This helps in maintaining continuity in the subjects.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Lack of Practice
&lt;/h3&gt;

&lt;p&gt;Mostly, the people try to rush and go through the theory completely. AI is not a small subject to be completed in a few weeks. It takes months to complete it. Also with the current emerging Gen AI, it became more necessary to stay updated. So, if you want to remember the vast amount of data, practice is the key. So, consider using 60% of your time for practice and remaining time to learn new stuff. There are many platforms like kaggle to practice and improve your skills.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Better Community
&lt;/h3&gt;

&lt;p&gt;Creating a better community among your friends will help learn Machine Learning faster. Form study groups, share resources, and participate in hackathons. A strong community can be invaluable for discussing ideas, solving doubts, and collaborating on projects.&lt;/p&gt;

&lt;p&gt;These activities not only boost your skills but also keep you motivated. Platforms like Discord, Reddit, and LinkedIn are great for connecting with like-minded individuals.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Selecting a Path after Machine Learning
&lt;/h3&gt;

&lt;p&gt;Learning only Machine Learning may not be sufficient for a successful career in the current scenario. From the other extensions like computer vision, natural language processing , Gen AI, etc, specializing in one based on your interests and building your career over that will be helpful.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Artificial Intelligence is a fascinating journey that requires patience, practice, and focus. Start small, stay consistent, and don’t hesitate to reach out to the community for support. Remember, every expert was once a beginner!&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>machinelearning</category>
      <category>ai</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
