<?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: ABYS</title>
    <description>The latest articles on DEV Community by ABYS (@abys_learning_2024).</description>
    <link>https://dev.to/abys_learning_2024</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%2F1753939%2Fd870318b-0dbe-43a2-b471-515990b40b26.jpg</url>
      <title>DEV Community: ABYS</title>
      <link>https://dev.to/abys_learning_2024</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abys_learning_2024"/>
    <language>en</language>
    <item>
      <title>Python - Indexing and Slicing</title>
      <dc:creator>ABYS</dc:creator>
      <pubDate>Wed, 24 Jul 2024 14:59:49 +0000</pubDate>
      <link>https://dev.to/abys_learning_2024/python-indexing-and-slicing-2moh</link>
      <guid>https://dev.to/abys_learning_2024/python-indexing-and-slicing-2moh</guid>
      <description>&lt;p&gt;Indexing &amp;amp; Slicing is an important concept in Python, especially when we use strings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Indexing :&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;WKT, string is nothing but a sequence of characters. &lt;br&gt;
So, each character has a position namely &lt;strong&gt;index&lt;/strong&gt; and accessing their position in that particular string is known as &lt;strong&gt;indexing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In Python, we have zero based indexing i.e., the first character of a string has an index(position) of 0 rather than having one, then the second character has an index(position) of 1 and so on.&lt;/p&gt;

&lt;p&gt;For example,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;     H E L L O W O R L D
&amp;gt;     0 1 2 3 4 5 6 7 8 9
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is known as &lt;strong&gt;positive indexing&lt;/strong&gt; as we have used only positive numbers to refer the indices.&lt;/p&gt;

&lt;p&gt;You may ask that "Then, we have negative indicing too??"&lt;br&gt;
Ofc, but in here we do not have zero as the first position as it ain't a negative number.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Negative indexing&lt;/strong&gt; allows us to access characters from the end of the string i.e., the last character has an index of -1, the second last character has an index of -2, and so on.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt;      H  E  L  L  O  W  O  R  L  D
&amp;gt;    -10 -9 -8 -7 -6 -5 -4 -3 -2 -1
&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;word = "HELLOWORLD"

print(word[0])
print(word[5])

H
W

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Similarly,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(word[-1])
print(word[-6])

D
0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it about indexing.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;&lt;em&gt;Slicing :&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think of slicing a string like cutting a slice of cake from a whole cake. We can specify where to start cutting (index), where to finish (end index), and even how big each slice should be (step). This way, we can create smaller portions of the cake (or string) exactly how we like them!&lt;/p&gt;

&lt;p&gt;In Python, slicing a string lets us grab specific parts of it by specifying where to start and where to end within the string. &lt;br&gt;
So, for instance, if message contains "HELLOWORLD", then message[3:7] gives you "LOWO" because it starts at index 3 ('L') and ends just before index 7 ('D'). This way, we can extract any part of a string we need!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- The basic syntax for slicing is,&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;string[start:stop]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The start index is where the slice begins, and this index is inclusive.&lt;/li&gt;
&lt;li&gt;The stop index is where the slice ends, but this index is exclusive, meaning the character at this index is not included in the slice.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;text = "HappyBirthday"

print(text[0:5])  
print(text[5:13])

Happy
Birthday  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When slicing a string in Python, we can simply omit the start or stop index to slice from the beginning or to the end of the string. &lt;br&gt;
It's as straightforward as that!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Slicing with a step,&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To specify the interval between characters when slicing a string in Python, just add a colon followed by the step value:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;This allows to control how we want to skip through the characters of the string when creating a slice.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;message = "HELLOWORLD"
print(message[1::2])    

EORL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;message[1::2] starts slicing from index 1 ('E') to the end of the string, with a step of 2.&lt;br&gt;
Therefore, it includes characters at indices 1, 3, 5, and 7, giving us "EORL".&lt;/p&gt;

&lt;p&gt;Until, we saw about &lt;strong&gt;positive slicing&lt;/strong&gt; and now let's learn about negative slicing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Negative Slicing :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A negative step allows you to slice the string in reverse order.&lt;/li&gt;
&lt;li&gt;Let us slice from the second last character to the third character in reverse order
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;message = "HELLOWORLD"
print(message[-2:2:-1])

ROWOL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;Let's look into certain questions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;#Write a function that takes a string and returns a new string consisting of its first and last character.&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;word = "Python"
end = word[0]+word[5]
print(end)

Pn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;#Write a function that reverses a given string.&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;word = "Python"
print(word[::-1])

nohtyP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;#Given a string, extract and return a substring from the 3rd to the 8th character (inclusive).&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;text = "MichaelJackson"
print(text[3:9])

haelJa
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;#Given an email address, extract and return the domain.&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;email = "hello_world@gmail.com"
domain = email[:-10]
print(domain)

hello_world
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;#Write a function that returns every third character from a given string.&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;text = "Programming"
print(text[::3])

Pgmn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;#Write a function that skips every second character and then reverses the resulting string.&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;text1 = "Programming"
print(text1[::-2])

gimroP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;#Write a function that extracts and returns characters at even indices from a given string.&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;text = "Programming"
print(text[::2])

Pormig
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Allright, that's the basic in here.&lt;/p&gt;

&lt;p&gt;.....&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>python</category>
    </item>
    <item>
      <title>Python - Functions</title>
      <dc:creator>ABYS</dc:creator>
      <pubDate>Fri, 19 Jul 2024 11:24:34 +0000</pubDate>
      <link>https://dev.to/abys_learning_2024/python-functions-53i4</link>
      <guid>https://dev.to/abys_learning_2024/python-functions-53i4</guid>
      <description>&lt;p&gt;FUNCTIONS, an awesome topic I learnt today. It's a shortcut for all lazy i.e., smart people who don't wanna waste their time typing inputs for several times. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;What Is a Function?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In programming, rather than repeatedly writing the same code , we write a function and use it whenever and whereever it is needed.&lt;br&gt;
It helps to improve modularity, code organization and reusability.&lt;/p&gt;

&lt;p&gt;So, now let's see how to create a function.&lt;br&gt;
A function contains,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;function name - an identifier by which a function is called&lt;/li&gt;
&lt;li&gt;arguments - contains a list of values passed to the function&lt;/li&gt;
&lt;li&gt;function body - this is executed each time the function is called function body must be intended&lt;/li&gt;
&lt;li&gt;return value - ends function call and sends data back to the                  program
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def function_name(arguments): # key function name(arguments)
  statement                   # function body
  statement

  return value                # return value

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Some examples of how to use functions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;#Write a function greet that takes a name as an argument and prints a greeting message.&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 greet(name):
    return(f"Hello, {name}!")
greet("ABY")

Hello, ABY!

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we can replace &lt;u&gt;return&lt;/u&gt; by &lt;u&gt;print&lt;/u&gt; too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;#Write a function sum_two that takes two numbers as arguments and returns their sum.&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_two(a,b):
    return a+b

result = add(3,7)
print(result)

10

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;#Write a function is_even that takes a number as an argument and returns True if the number is even, and False if it is odd.&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 is_even(num):
    return num % 2 == 0

num = 5
print(is_even(num))

False

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;#Write a function find_max that takes two numbers as arguments and returns the larger one.&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 find_max(a,b):
    if a &amp;gt; b:
      return a
    else:
      return b

print(find_max(7,9))

9

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;#Write a function multiplication_table that takes a number n and prints the multiplication table for n from 1 to 10.&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 multiplication_table(n):
    for I in range (1,11)
    result = n * i 

print(f"{n} * {i} = {result}")
n = multiplication_table(int(input("Enter a no: ")))

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and the result is,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter a no: 5 # I've entered 5
5 * 1 = 5
5 * 2 = 10
5 * 3 = 15
5 * 4 = 20
5 * 5 = 25
5 * 6 = 30
5 * 7 = 35
5 * 8 = 40
5 * 9 = 45
5 * 10 = 50

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;#Write a function celsius_to_fahrenheit that takes a temperature in Celsius and returns the temperature in Fahrenheit.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is how we normally do it..&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;celsius1 = 27
fahrenheit1 = (celsius1 * 9/5) + 32
print(f"{celsius1}°C is {fahrenheit1}°F")

celsius2 = 37
fahrenheit2 = (celsius2 * 9/5) + 32
print(f"{celsius2}°C is {fahrenheit2}°F")

celsius3 = 47
fahrenheit3 = (celsius3 * 9/5) + 32
print(f"{celsius3}°C is {fahrenheit3}°F")

27°C is 80.6°F
37°C is 98.6°F
47°C is 116.6°F

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's cumbersome right?? &lt;br&gt;
Soo, what's the shortcut? Ofc using a function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def celsius_to_fahrenheit(celsius):
  return (celsius * 9/5) + 32

celsius = float(input("Celsius: "))
fahrenheit = celsius_to_fahrenheit(celsius)
print(f"{celsius}°C is {fahrenheit}°F")

Celsius: 37.5
37.5°C is 99.5°F

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I've used input function to make it more compact...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;#Write a function power that takes two arguments, a number and an exponent, and returns the number raised to the given exponent. The exponent should have a default value of 2.&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 pow(num,exp = 2):
  return num ** exp


result = pow(5,exp = 2)
print(f"The number {num} raised to power 2 is ",{result})

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can opt to use input fns and variables as well..&lt;/p&gt;

&lt;p&gt;By now, it's understandable that for one problem we can use multiple&lt;br&gt;
programs to solve it. It depends which we prefer to use.&lt;/p&gt;

&lt;p&gt;.....&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>functions</category>
    </item>
    <item>
      <title>Python - Operators and Conditionals</title>
      <dc:creator>ABYS</dc:creator>
      <pubDate>Wed, 17 Jul 2024 10:31:10 +0000</pubDate>
      <link>https://dev.to/abys_learning_2024/python-operators-and-conditionals-2b3k</link>
      <guid>https://dev.to/abys_learning_2024/python-operators-and-conditionals-2b3k</guid>
      <description>&lt;p&gt;In this blog, we'll get to know about operators, conditionals and input() functions.&lt;br&gt;
Let's jump into Operators.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;What are Operators ?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Symbols that perform specific mathematical / logical operations in computer.&lt;br&gt;
This is of 3 types namely; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Arithmetic operators&lt;/li&gt;
&lt;li&gt;Comparison operators&lt;/li&gt;
&lt;li&gt;Logical operators&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;What are these and what functions they perform ?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Lemme tell something, you guys will be surprised to learn how simple it is...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;1.Arithmetic operators&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It includes basic mathematics like addition, subtraction, multiplication, division and few more..&lt;br&gt;
We've seen all these in previous blog where we created a calculator.&lt;/p&gt;

&lt;p&gt;ok you would be asking what about the remaining two..&lt;br&gt;
yeah, I'll discuss that now.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;2.Comparison operators&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It compare two values and return either True or False.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Equal to ( == ) &lt;/li&gt;
&lt;li&gt;Not equal to ( != )&lt;/li&gt;
&lt;li&gt;Greater than ( &amp;gt; )&lt;/li&gt;
&lt;li&gt;Less than ( &amp;lt; )&lt;/li&gt;
&lt;li&gt;Greater than or equal to ( &amp;gt;= )&lt;/li&gt;
&lt;li&gt;Less than or equal to ( &amp;lt;= )&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For ex,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 2
b = 4

result = (a &amp;gt; b)
print(result)

False

&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;a = 2
b = 4

result = (a &amp;lt;= b)
print(result)

True

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;3.Logical operators&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Used to combine conditionals (if, else)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;and - if both the statements are true, Returns True.&lt;/li&gt;
&lt;li&gt;or - if one of the statements is true, Returns True.&lt;/li&gt;
&lt;li&gt;not - returns False if the result is true i.e, Reverses the result.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#and
condition_1 = True
condition_2 = True
print(condition_1 and condition_2)

True

condition_1 = True
condition_2 = False
print(condition_1 and condition_2)

False

#or
condition_1 = True
condition_2 = False
print(condition_1 or condition_2)

True

&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;#not
condition_1 = True
print(not condition_1 )

False

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this, Operators done.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;&lt;em&gt;Now, What are Conditionals ?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It used decide which path to take based on given conditions. &lt;/li&gt;
&lt;li&gt;The commonly used conditional statements in Py. are if, elif, and else.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Lemme explain it using a realtime scenario,&lt;br&gt;
I'm planning to go out and I wanna select my clothes. So, I've three options tracks, dress or I'm not going.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;if tracks_available:&lt;br&gt;
    wear tracts&lt;br&gt;
elif dress_aviable:&lt;br&gt;
    wear dress&lt;br&gt;
else:&lt;br&gt;
    sit at home&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The same we're gonna do it by coding.&lt;br&gt;
Let's compare two numbers;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 25
b = 25
if a &amp;gt; b:
    print("a is greater than b")
elif a == b:
    print("a is equal to b")
else:
    print("a is less than b")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, each condition is checked by steps, as according to line 5 and 6&lt;br&gt;
the result will be as following..&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a is equal to b

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;em&gt;Get User Input using input()&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is to get input from the user. &lt;br&gt;
We always get input in string type i.e, text format, so if we need a number we've to convert it.&lt;/p&gt;

&lt;p&gt;Here's a basic usage of this function:&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("What is your name? ")
print("Hello, " + name + "!")
print("Have a nice day.")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It asks the user for their name and then prints as given.&lt;br&gt;
But, that's not the case for numbers as we've discussed earlier while creating calculator. &lt;/p&gt;

&lt;p&gt;For numbers we ought to convert the input from string to an integer or float..&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;age = input("Enter your age: ")
age = int(age)
print("You are " + str(age) + " years old.")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;age = int(input("Enter your age: "))
print("You are " + str(age) + " years old.")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let us now look into a question which comprises it all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Create a program that asks the user to enter a number and then prints whether the number is positive, negative, or zero.&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;num = float(input("Enter a number: "))
if num &amp;gt; 0 :
   result = "positive"
elif num &amp;lt; 0 :
   result = "negative"
else :
   result = 0
print(f"The number is {result}.")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This program&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Asks the user to enter a number.&lt;/li&gt;
&lt;li&gt;Converts the input to a float (as it could be applicable for                decimals too)&lt;/li&gt;
&lt;li&gt;Check if the number is positive, negative, or zero, and prints the result.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Okay, with this in our mind try to make a grading system.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Grading system&lt;br&gt;
A - 100 to 90&lt;br&gt;
B - 90 to 80&lt;br&gt;
C - 80 to 70&lt;br&gt;
D - 70 to 60&lt;br&gt;
E - 60 to 45&lt;br&gt;
FAIL - 45 to 0&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Lets create  a program that takes a numerical grade as input and prints the corresponding letter grade (A, B, C, D, or F). Total Marks is 100. &lt;/p&gt;

&lt;p&gt;mark = float(input("Enter your mark : "))&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if mark &amp;gt;= 91 and mark &amp;lt;= 100:
    print("Grade A")
elif mark &amp;gt;= 81 and mark &amp;lt; 91:
    print("Grade B")
elif mark &amp;gt;= 71 and mark &amp;lt; 81:
    print("Grade C")
elif mark &amp;gt;= 61 and mark &amp;lt; 71:
    print("Grade D")
elif mark &amp;gt;= 45 and mark &amp;lt; 61:
    print("Grade E")
elif mark &amp;lt; 45:
    print("Fail")
else:
    print("Mark not valid")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Try it out yourself...&lt;/p&gt;

</description>
      <category>python</category>
      <category>tutorial</category>
      <category>learning</category>
    </item>
    <item>
      <title>Let's make a Calculator using Py.</title>
      <dc:creator>ABYS</dc:creator>
      <pubDate>Tue, 16 Jul 2024 14:48:42 +0000</pubDate>
      <link>https://dev.to/abys_learning_2024/lets-make-a-calculator-ef4</link>
      <guid>https://dev.to/abys_learning_2024/lets-make-a-calculator-ef4</guid>
      <description>&lt;p&gt;Before we actually make a calculator, let's first see some basic mathematical expressions...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;1. Add&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;num1 = 2
num2 = 3
print(num1+num2) 

5

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;2. Subtract&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;num1 = 7
num2 = 5
print(num1-num2)

2

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;3. Multiply&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;num1 = 5
num2 = 5
print(num1*num2)

25

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;4. Divide&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;num1 = 100
num2 = 5
print(num1/num2)

20

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;5. Modulus&lt;/em&gt;&lt;/strong&gt; (nothing but remainder)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;quotient = 5//2
remainder = 5 % 2
print(quotient , "," ,remainder)

2 , 1

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;6.Exponentiate&lt;/em&gt;&lt;/strong&gt; (powers)&lt;/p&gt;

&lt;p&gt;For ex; a power b in python written as a**b&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;num1 = 3
num2 = 3
print(num1**num2)

27

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;&lt;em&gt;Input Datatype and Typecasting&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;# Addition

num1 = int(input("Enter Number 1 : "))
num2 = int(input("Enter Number 2 : "))

result = num1+num2
print("Result is : ", result)

Enter Number 1 : 1
Enter Number 2 : 4
Result is :  5

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here it appears as steps but I'm unable to present it.&lt;br&gt;
You can just do it and see.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# to make it possible in decimals too we use float

num1 = float(input("Enter Number 1 : "))
num2 = float(input("Enter Number 2 : "))

result = num1+num2
print("Result is : ", result) 

Enter Number 1 : 1.5
Enter Number 2 : 2.5
Result is :  4.0

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Similarly, we do for other operations.&lt;/p&gt;

&lt;p&gt;Now, with this knowledge we gonna create a simple calculator by using the following code;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print("Simple Calculator")
print("Select Operation : ")
print("1. Add")
print("2. Subtract")
print("3. Multiply")
print("4. Divide")
print("5. Modulus")
print("6. Exponentiate")

choice = input("Enter choice (1/2/3/4/5/6) : ")
num1 = float(input("Enter first  Number : "))
num2 = float(input("Enter second Number : "))

if choice == "1" :
   result = num1 + num2
   print(result)
elif choice == "2" :
   result = num1 - num2
   print(result)
elif choice == "3" :
   result = num1 * num2
   print(result)
elif choice == "4" :
   result = num1 / num2
   print(result)
elif choice == "5" :
   result = num1 % num2
   print(result)
elif choice == "6" :
   result = num1 ** num2
   print(result)
else :
   print("option not available")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, that's what I learned under this topic.&lt;br&gt;
You can use the same code above and chk whether it works for you too..&lt;/p&gt;

&lt;p&gt;Platforms I use to try these codes : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;W3 Schools Tryit Editor&lt;/li&gt;
&lt;li&gt;Google Colaboratory&lt;/li&gt;
&lt;li&gt;Visual Studio Code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;.....&lt;/p&gt;

</description>
      <category>programming</category>
      <category>python</category>
      <category>calculator</category>
    </item>
    <item>
      <title>Python - Fundamentals</title>
      <dc:creator>ABYS</dc:creator>
      <pubDate>Tue, 16 Jul 2024 14:00:46 +0000</pubDate>
      <link>https://dev.to/abys_learning_2024/python-fundamentals-346p</link>
      <guid>https://dev.to/abys_learning_2024/python-fundamentals-346p</guid>
      <description>&lt;p&gt;In here, I'm gonna tell you how to use variables in python. We shall see how to name a variable and assign values to them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;How to name a Variable ?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Firstly a variable is nothing but a reference to an object or value throughout the program. They act as reference to a memory where the value is stored.&lt;/p&gt;

&lt;p&gt;There are certain rules to name them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Must begin with a letter (a-z, A-Z) or an underscore (_).&lt;/li&gt;
&lt;li&gt;After the first character, letters, digits (0-9), or underscores can be followed.&lt;/li&gt;
&lt;li&gt;Variable names are case-sensitive. 
For ex, myName and myname are entirely different variables.&lt;/li&gt;
&lt;li&gt;Should not use Python reserved words as variable names 
For ex: class, def, for, while.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, in python the operator = is used for assigning values to variables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Assigning integer value
age = 18
print(age)

18

# Assigning string value
name = "Arif"
print(name)

Arif

# Assigning float value (float means decimal value)
height = 2.5
print(height)

2.5

# Assigning boolean value (rfrs to true/false)
is_student = True
print(is_student)

True

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;Varible Types&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Python is a typed lang, we needn't declare the type of a variable when assigning a value to it. The type is inferred by its own.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name = "Abys"
print(name)
print(type(name))

Abys
&amp;lt;class 'str'&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or we can also define the type by,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name = "Abys"
type(name)

str

age = 18
type(age)

int

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the basic.&lt;/p&gt;




&lt;p&gt;I've been asked to complete some questions on my own, lemme discuss those with you guys.&lt;br&gt;
It's much easier to learn right...?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;1. Create a variable named name and assign your name to it. Then print the value of the variable.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name = "Abys"
print(name)
print(type(name))

Abys
&amp;lt;class 'str'&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;2. Create a variable age and assign your age to it. Later, reassign the variable with a new value and print the new value.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;age=17
print("Present age:",age)
age= 18
print(age)

Present age: 17
18

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and here if we want the type;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(type(age))
&amp;lt;class 'int'&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;3. Assign the values 5, 10, and 15 to three variables a, b, and c in a single line. Print their values.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a,b,c = 5,10,15
print(a,b,c)

5 10 15

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;if we wanna add them we get,&lt;br&gt;
&lt;/p&gt;

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

30

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;4. Swap the values of two variables x and y without using a third variable. Print their values before and after swapping.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x,y = 5,25
print(x,y)
print(x-y)
x,y = 25,5
print(x,y)
print(x-y)

5 25
-20
25 5
20

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;they've asked just to print the swapped values, it's me who did extra stuffs.&lt;/p&gt;

&lt;p&gt;Before the next qn we ought to know what is constants...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;What are Constants ?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Python, constants are those values that are not meant to change. By convention, they are typically written in capital letters with underscores separating the words.&lt;br&gt;
However, in python constants can also be changed.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;5. Define constants PI with appropriate values and print them.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PI=3.14159
print(f"{PI:.3f}")

3.142

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;6. Write a program that calculates the area of a circle using the constant PI and a variable radius. Print the area.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PI=3.14
radius=7
r=radius
area=PI*r**2 # r**2 refers to r pow 2
print("Area of circle is",area)

Area of circle is 153.86

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;7. Define constants for the length and width of a rectangle. Calculate and print the area.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;L,B = 5,15
area = L*B
print("Area of rect is ",area)

Area of rect is  75

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These were the qns I worked on. Hope it is clear.&lt;br&gt;
Sorry, if I'm ain't clear enough.., as I've just started blogging I may make mistakes.&lt;br&gt;
Definitely will improve myself.&lt;br&gt;
Thank you, All...&lt;/p&gt;

</description>
      <category>python</category>
      <category>coding</category>
      <category>basic</category>
    </item>
    <item>
      <title>My First Blog _Python</title>
      <dc:creator>ABYS</dc:creator>
      <pubDate>Tue, 16 Jul 2024 08:39:34 +0000</pubDate>
      <link>https://dev.to/abys_learning_2024/my-first-blog-python-4h5n</link>
      <guid>https://dev.to/abys_learning_2024/my-first-blog-python-4h5n</guid>
      <description>&lt;p&gt;Hi All,&lt;/p&gt;

&lt;p&gt;This is my very first blog. I'm a Biomath student who has zero knowledge about computer related stuffs.&lt;br&gt;
Later, I was convinced to study a programming language yet confused with how,where and what to start...?&lt;/p&gt;

&lt;p&gt;And finally decided to learn python, as people around me implied that it's easy to start with... So, now I'm learning python from an online platform., which teaches me so fine...&lt;/p&gt;

&lt;p&gt;I thought of blogging it all, cause people like me will get to know that python isn't overly challenging rather as simple as English grammar.&lt;/p&gt;

&lt;p&gt;We can learn python just by using "Google Colaboratory", yet I would let u know how to install python later.&lt;/p&gt;

&lt;p&gt;So, join with me... &lt;br&gt;
Let's start to learn PYTHON&lt;/p&gt;



&lt;p&gt;&lt;em&gt;&lt;strong&gt;PYTHON BASICS&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Printing a String :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;To print a text, we use print function  -  print()&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Let's begin with "Hello World".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;By writing certain text within the print function inside double or single quotes, we get :&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;print("Hello World")

Hello World

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;2. Similarly, we can Print Variables :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Variables are used to store data.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name = "Abys"
print(name)

Abys

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Here, if we give numbers as values for the variable (ex: age=25)
we needn't provide them under double or single quotes as they give the same output but as for texts we should use "" or ''.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;age = 25 
print(age)

25

age = "25"
print(age)

25

name = Abys
print(name)

Traceback (most recent call last):
  File "./prog.py", line 4, in &amp;lt;module&amp;gt;
NameError: name 'Abys' is not defined

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;That's the reason for this rule. Hope it's clear., &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Printing Multiple Items :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We can print multiple items by separating them with commas while python adds space between each item.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Formatting strings with f strings&lt;/strong&gt; is another sub topic where we  insert variables directly into the string by prefixing it with an f and using curly braces {} around the variables.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;let's see both,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name="Abys"
age=17
city="Madurai"
print("Name:",name , "Age:",age , "City:",city ,end=".")

Name: Abys Age: 17 City: Madurai.


name="Abys"
age=17
city="Madurai"
print(f"Name:{name},Age:{age},City:{city}.")

Name:Abys,Age:17,City:Madurai.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4.Concatenation of Strings :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Here, we connect words using + operator.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;w1="Sambar"
w2="Vada"
print(w1+" "+w2+"!")

Sambar Vada!

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Let's also see what is &lt;strong&gt;Printing Quotes inside Strings&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To print quotes inside a string, we can use either single or double quotes to enclose the string and the other type of quotes inside it.&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;w1="Sambar"
w2="Vada"
print("I love" , w1+" "+w2+"!")

I love Sambar Vada!

hobby = "Singing"
print("My hobby is" , hobby)

My hobby is Singing

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5.Escape Sequences and Raw Strings to Ignore Escape Sequences :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Escape sequences allows to include special characters in a string. For example, \n adds a new line.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print("line1\nline2\nline3")

line1
line2
line3

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;r string is used as prefix which treats backslashes as literal characters.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(r"C:\Users\Name")

C:\Users\Name

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;6.Printing Results of Mathematical Expressions :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We've already seen how to print numbers.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(26)

26

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Now,  we're going to print certain eqns.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(5+5)

10

print(3-1)

2

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;that's how simple it is...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7.Printing Lists and Dictionaries :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We can print entire lists and dictionaries.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fruits = ["apple", "banana", "cherry"]
print(fruits)

['apple', 'banana', 'cherry']

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;8.Using sep and end Parameters :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The sep parameter changes the separator between items.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The end parameter changes the ending character.&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;print("Happy", "Holiday's", sep="-", end="!")

Happy-Holiday's!

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Let's see how to print the same in adjacent lines, here we use either escape sequences (\n) or &lt;strong&gt;Multiline Strings&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Triple quotes allow you to print multiline strings easily.&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;print("""Happy
Holiday's""")

print("Happy\nHoliday's")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;both gives same output as :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Happy
Holiday's

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;9.Combining Strings and Variables :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Combining strings and variables by using + for simple cases or formatted strings for more complex scenarios.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For simple case:&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;colour = "purple"
print("The colour of the bag is "+colour)

The colour of the bag is purple

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;For complex case :
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;temperature=22.5
print("The temperature is", str(temperature),"degree Celsius",end=".")

The temperature is 22.5 degree Celsius.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;10.Printing with .format() and Using print for Debugging:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use the .format() method for string formatting.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name="Abys"
age=17
city="Madurai"
print("Name:{}, Age:{}, City:{}".format(name,age,city))

Name:Abys, Age:17, City:Madurai

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;We can use print to debug your code by printing variable values at different points.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def add(a, b):
    print(f"Adding {a} and {b}")
    return a + b

result = add(1, 2)
print("Result:", result)

Adding 1 and 2
Result: 3

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it.&lt;br&gt;
These were the topics I learned in my 1st class.&lt;/p&gt;

&lt;p&gt;At the beginning, I was confused by all the terms but as time went I got used to it just like we first started to learn English.&lt;/p&gt;

&lt;p&gt;Try it out yourself... as u begin to get the output., it's next level feeling.&lt;br&gt;
I personally felt this; &lt;br&gt;
   "Nammalum Oru Aal Than Pola"...&lt;/p&gt;

&lt;p&gt;.....&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
