<?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: varatharajan</title>
    <description>The latest articles on DEV Community by varatharajan (@varatha).</description>
    <link>https://dev.to/varatha</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%2F2406598%2F58d23d2b-9099-4134-8d3e-e4c3d1a2f681.png</url>
      <title>DEV Community: varatharajan</title>
      <link>https://dev.to/varatha</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/varatha"/>
    <language>en</language>
    <item>
      <title>கடலலை</title>
      <dc:creator>varatharajan</dc:creator>
      <pubDate>Thu, 28 Nov 2024 14:21:06 +0000</pubDate>
      <link>https://dev.to/varatha/kttllai-54k5</link>
      <guid>https://dev.to/varatha/kttllai-54k5</guid>
      <description>&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%2Fk3gtuxmoxvatv1lrzd57.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%2Fk3gtuxmoxvatv1lrzd57.jpg" alt="Image description" width="800" height="1333"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>while loop - task</title>
      <dc:creator>varatharajan</dc:creator>
      <pubDate>Thu, 28 Nov 2024 08:27:37 +0000</pubDate>
      <link>https://dev.to/varatha/while-loop-task-501b</link>
      <guid>https://dev.to/varatha/while-loop-task-501b</guid>
      <description>&lt;p&gt;Here are some while loop questions focused on numbers for practice:&lt;/p&gt;

&lt;p&gt;Basic Problems :&lt;br&gt;
&lt;strong&gt;Print Numbers :&lt;/strong&gt;&lt;br&gt;
    Write a program to print numbers from 1 to 10 using a while loop.&lt;br&gt;
input :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def print_number(no):
    num=1
    while num&amp;lt;=no:
        print(num,end=' ')
        num+=1

print_number(10)

&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;no = 1
while no&amp;lt;=10:
    print(no, end=' ')
    no+=1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output :&lt;br&gt;
&lt;code&gt;&lt;br&gt;
1 2 3 4 5 6 7 8 9 10&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Sum of N Numbers :&lt;/strong&gt;&lt;br&gt;
    Write a program to calculate the sum of the first NN natural numbers using a while loop.&lt;br&gt;
input :&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_of_natural_numbers(no):
    sum = 0
    num = 1  
    while num &amp;lt;= no:
        sum =sum + num  
        num += 1  
    return sum

no = int(input("Enter a number: "))

result = sum_of_natural_numbers(no)
print("The sum of the first", no, "natural numbers is:", result)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output :&lt;br&gt;
&lt;code&gt;&lt;br&gt;
Enter a number: 5&lt;br&gt;
The sum of the first 5 natural numbers is: 15&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Even Numbers&lt;/strong&gt;&lt;br&gt;
    Write a program to print all even numbers between 1 and 50 using a while loop.&lt;br&gt;
input :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def even_numbers(num):

    no = 2
    while no&amp;lt;=num:
        print(no, end=' ')
        no+=2

even_numbers(50)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Odd Numbers&lt;/strong&gt;&lt;br&gt;
Write a program to print all odd numbers between 1 and NN.&lt;br&gt;
input:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def print_odd_number(no):
    num=1
    while num&amp;lt;=no:
        print(num, end=" ")
        num+=2
    return no
no=int(input("Enter the number:"))
print_odd_number(no)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output :&lt;br&gt;
&lt;code&gt;&lt;br&gt;
Enter the number:50&lt;br&gt;
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Reverse Count&lt;/strong&gt;&lt;br&gt;
      Write a program to print numbers from 20 to 1 in reverse order using a while loop.&lt;br&gt;
input:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def print_reverse_number(no):
    num=20
    while num&amp;gt;=no:
        print(num, end=" ")
        num-=1
print_reverse_number(1)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Intermediate Problems:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Factorial Calculation&lt;/strong&gt;&lt;br&gt;
     Write a program to calculate the factorial of a given number using a while loop.&lt;br&gt;
input:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def factorial(no):
    num=1
    factorial=1
    while num&amp;lt;=no:
        factorial=factorial*num
        num+=1
    return factorial

no = int(input("Enter the number : "))
print(factorial(no))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
Enter the number : 4&lt;br&gt;
24&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>looping</title>
      <dc:creator>varatharajan</dc:creator>
      <pubDate>Tue, 26 Nov 2024 09:10:25 +0000</pubDate>
      <link>https://dev.to/varatha/looping-5ba9</link>
      <guid>https://dev.to/varatha/looping-5ba9</guid>
      <description>&lt;p&gt;&lt;strong&gt;while :&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Task :&lt;/p&gt;

&lt;p&gt;1) 1 2 3 4 5 6 7 8 9 10&lt;br&gt;
2) 10 9 8 7 6 5 4 3 2 1&lt;br&gt;
3) 1 3 5 7 9&lt;br&gt;
4) 2 4 6 8 10&lt;br&gt;
5) 3 6 9&lt;/p&gt;

&lt;p&gt;input :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#1 2 3 4 5 6 7 8 9 10
no = 1
while no&amp;lt;=10:
    print(no, end=' ')
    no+=1

print()

# 10 9 8 7 6 5 4 3 2 1
no = 10
while no&amp;gt;=1:
    print(no, end=' ')
    no-=1

print()

# 1 3 5 7 9 
no = 1
while no&amp;lt;=10:
    print(no, end=' ')
    no+=2

print()

#2 4 6 8 10
no=2
while no&amp;lt;=10:
    print(no, end=' ')
    no+=2

print()

# 3 6 9
no = 3
while no&amp;lt;=10:
    print(no, end=' ')
    no+=3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output :&lt;br&gt;
&lt;code&gt;&lt;br&gt;
1 2 3 4 5 6 7 8 9 10&lt;br&gt;
10 9 8 7 6 5 4 3 2 1&lt;br&gt;
1 3 5 7 9&lt;br&gt;
2 4 6 8 10&lt;br&gt;
3 6 9&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
using '*'&lt;br&gt;
input&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# 3 6 9 12 15 18 21
no = 1
while no&amp;lt;=7:
    print(no*3, end=' ')
    no+=1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output&lt;br&gt;
&lt;code&gt;&lt;br&gt;
3 6 9 12 15 18 21&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Task :&lt;br&gt;
 1 *  5 = 5&lt;br&gt;
 2 *  5 = 10&lt;br&gt;
 3 *  5 = 15&lt;/p&gt;

&lt;p&gt;input&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;no = 1 
while no&amp;lt;=10:
    result = no*5
    print(f"{no}*5 = {result}")
    no+=1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output&lt;br&gt;
&lt;code&gt;&lt;br&gt;
1*5 = 5&lt;br&gt;
2*5 = 10&lt;br&gt;
3*5 = 15&lt;br&gt;
4*5 = 20&lt;br&gt;
5*5 = 25&lt;br&gt;
6*5 = 30&lt;br&gt;
7*5 = 35&lt;br&gt;
8*5 = 40&lt;br&gt;
9*5 = 45&lt;br&gt;
10*5 = 50&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
example :&lt;/p&gt;

&lt;p&gt;1*2=2&lt;br&gt;
3*2=6&lt;br&gt;
5*2=10&lt;br&gt;
7*2=14&lt;br&gt;
9*2=18&lt;/p&gt;

&lt;p&gt;input&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;no = 1
while no&amp;lt;=10:
    result=no*2
    print(f"{no}*2={result}")
    no+=2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output&lt;br&gt;
&lt;code&gt;&lt;br&gt;
1*2=2&lt;br&gt;
3*2=6&lt;br&gt;
5*2=10&lt;br&gt;
7*2=14&lt;br&gt;
9*2=18&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
example :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#1 3 5 7 9 2 4 6 8 10

no = 1
while no&amp;lt;=10:
    print(no, end = ' ')
    if no==9:
       no=0
    no+=2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output&lt;br&gt;
&lt;code&gt;&lt;br&gt;
1 3 5 7 9 2 4 6 8 10&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>while loop, predefind modules</title>
      <dc:creator>varatharajan</dc:creator>
      <pubDate>Sun, 24 Nov 2024 12:14:27 +0000</pubDate>
      <link>https://dev.to/varatha/task-9h0</link>
      <guid>https://dev.to/varatha/task-9h0</guid>
      <description>&lt;p&gt;&lt;strong&gt;The while Loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With the while loop we can execute a set of statements as long as a condition is true.&lt;/p&gt;

&lt;p&gt;input&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;i = 1
while i &amp;lt; 6:
  print(i)
  i = i+1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output&lt;br&gt;
&lt;code&gt;&lt;br&gt;
1&lt;br&gt;
2&lt;br&gt;
3&lt;br&gt;
4&lt;br&gt;
5&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
For writing multiple "if"conditions we can use "while"loop for repeated condition.&lt;br&gt;
example :&lt;br&gt;
To get this output 1 1 1 1 1 we have various syntax but we can use if and while now.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;case 1 :

#using if condition

count = 1
if count&amp;lt;=5:
    print(1, end=' ')
    count=count+1 #count = 2
if count&amp;lt;=5:
    print(1, end=' ')
    count=count+1 # count = 3

if count&amp;lt;=5:
    print(1, end=' ')
    count=count+1 # count = 4

if count&amp;lt;=5:
    print(1, end=' ')
    count=count+1 # count = 5

if count&amp;lt;=5:
    print(1, end=' ')
    count=count+1 # count = 6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output&lt;br&gt;
&lt;code&gt;&lt;br&gt;
1 1 1 1 1&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
case 2 :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;count = 1
while count&amp;lt;=5:
    print(1, end=' ')
    count=count+1 #count = 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output&lt;br&gt;
&lt;code&gt;&lt;br&gt;
1 1 1 1 1&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Task 1:&lt;/p&gt;

&lt;p&gt;Create a python module called Bank.&lt;br&gt;
Add functions: deposit(amount), withdraw(amount)&lt;br&gt;
Create one more python module called Customer&lt;br&gt;
From customer module, call deposit and withdraw functions of Bank module.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#bank.py

def deposit(amount):
    print("Total deposit amount is ",amount)
    return(amount)

def withdraw(amount):
    print("Total withdrawal amount is ",amount)
    return(amount)
&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;#customer.py

import Bank

total_deposit=Bank.deposit(200000)
total_withdrawal=Bank.withdraw(20000)

print("Bank balance is ",(total_deposit-total_withdrawal))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
Total deposit amount is  200000&lt;br&gt;
Total withdrawal amount is  20000&lt;br&gt;
Bank balance is  180000&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;predefined modules:&lt;/strong&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  random :
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;input&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;import random
otp = random.randint(0,9999)
print(otp)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
4321&lt;br&gt;
3185&lt;br&gt;
4238&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  math
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;input&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;import math
print(math.sqrt(9))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;&lt;br&gt;
3.0&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  datetime
&lt;/h1&gt;

&lt;p&gt;input&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from datetime import datetime

now = datetime.now()
print("Current Date and Time:", now)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;output&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
Current Date and Time: 2024-11-25 13:31:37.449457&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Modules</title>
      <dc:creator>varatharajan</dc:creator>
      <pubDate>Fri, 22 Nov 2024 08:31:42 +0000</pubDate>
      <link>https://dev.to/varatha/modules-user-defined-predefined-4and</link>
      <guid>https://dev.to/varatha/modules-user-defined-predefined-4and</guid>
      <description>&lt;h1&gt;
  
  
  Modules :
&lt;/h1&gt;

&lt;p&gt;Every python file is a module.&lt;br&gt;
To create a module just save the code you want in a file with the file extension .py&lt;br&gt;
Modules have special variables.&lt;br&gt;
example:&lt;br&gt;
&lt;strong&gt;file&lt;/strong&gt;   (file----&amp;gt;The file path of the module)&lt;br&gt;
&lt;strong&gt;name&lt;/strong&gt;   (name----&amp;gt;Name of the module)&lt;br&gt;
&lt;strong&gt;doc&lt;/strong&gt;    (documtation string of the module) ("""abcd""" or '''abcd''')&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;input&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;#current module name - vara.py

""" The nature is beautiful"""
print(__name__) 
print(__file__)
print(__doc__)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;__main__&lt;br&gt;
C:\Users\Lakshmipriya\OneDrive\Desktop\VARATHARAJAN\vara.py&lt;br&gt;
 The nature is beautiful&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;The import statement&lt;/strong&gt;&lt;br&gt;
      The import statement in Python is used to bring code from one module into another.&lt;br&gt;
example :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#num.py

def add(no1,no2):
    print(no1+no2)


def subtract(no1,no2):
    print(no1-no2)


def multiply(no1,no2):
    print(no1*no2)


def divide(no1,no2):
    print(no1/no2)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;input&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;#vara.py

import num

num.add(10,20)
num.subtract(50,25)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;output *&lt;/em&gt;&lt;br&gt;&lt;br&gt;
&lt;code&gt;&lt;br&gt;
30&lt;br&gt;
25&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
If we need specific functions alone from one module means then no need to import whole module,instead we can use "from" to take specific function&lt;/p&gt;

&lt;p&gt;example&lt;br&gt;
&lt;strong&gt;input&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;#vara.py

from num import add,subtract

add(10,20)
subtract(50,25)
multiply(10,20) #this function is not defind
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
30&lt;br&gt;
25&lt;br&gt;
Traceback (most recent call last):&lt;br&gt;
  File "C:\Users\Lakshmipriya\OneDrive\Desktop\VARATHARAJAN\vara.py", line 7, in &amp;lt;module&amp;gt;&lt;br&gt;
    multiply(10,20)&lt;br&gt;
NameError: name 'multiply' is not defined&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
help()&lt;br&gt;
To see all details about the particular module like functions, file location, including documentation string.&lt;/p&gt;
&lt;h1&gt;
  
  
  num.py
&lt;/h1&gt;

&lt;p&gt;''' This module contain some functions'''&lt;/p&gt;

&lt;p&gt;def add(no1,no2):&lt;br&gt;
    print(no1+no2)&lt;/p&gt;

&lt;p&gt;def subtract(no1,no2):&lt;br&gt;
    print(no1-no2)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;input&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;import num
print(help(num))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output&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;NAME
    num - This module contain some functions

FUNCTIONS
    add(no1, no2)

    divide(no1, no2)

    multiply(no1, no2)

    subtract(no1, no2)

FILE
    c:\users\lakshmipriya\onedrive\desktop\varatharajan\num.py


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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>for loop &amp; If,else condition</title>
      <dc:creator>varatharajan</dc:creator>
      <pubDate>Wed, 20 Nov 2024 10:22:06 +0000</pubDate>
      <link>https://dev.to/varatha/for-loop-ifelse-condition-4b5i</link>
      <guid>https://dev.to/varatha/for-loop-ifelse-condition-4b5i</guid>
      <description>&lt;p&gt;&lt;strong&gt;For loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The for Loops in Python are a special type of loop statement that is used for sequential traversal. Python for loop is used for iterating over an iterable like a String, Tuple, List, Set, or Dictionary.&lt;/p&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%2Fjr8zrlxde9wqylt43sry.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%2Fjr8zrlxde9wqylt43sry.png" alt="Image description" width="551" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name = 'varatharajan'

for alphabet in name:
    print(alphabet, end=' ')


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

&lt;/div&gt;



&lt;p&gt;result&lt;/p&gt;

&lt;p&gt;&lt;code&gt;v a r a t h a r a j a n&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;if,else&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The if statement is the most simple decision-making statement. It is used to decide whether a certain statement or block of statements will be executed or not.&lt;br&gt;
The elif keyword is Python's way of saying "if the previous conditions were not true, then try this condition".&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 33
b = 200
if b &amp;gt; a:
  print("b is greater than a")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;result&lt;br&gt;
&lt;code&gt;b is greater than a&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
example 2 :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;txt = '12a4'

for num in txt:
    if num&amp;gt;='0' and num&amp;lt;='9':
        print(num,end=' ')
    else:
        print('Not Decimal',end=' ')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;result&lt;br&gt;
&lt;code&gt;1 2 Not Decimal 4&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Task :&lt;br&gt;
name = input("Enter Name: ")&lt;br&gt;
Lakshmi pritha&lt;br&gt;
Guru prasanna&lt;br&gt;
Guhanraja&lt;br&gt;
Varatharajan&lt;/p&gt;

&lt;p&gt;1: Names starting with letter 'G'&lt;br&gt;
2: Names endings with 'a'&lt;br&gt;
3: Names having space in between&lt;br&gt;
4: Names having more than 9 letters&lt;/p&gt;

&lt;h1&gt;
  
  
  input
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name1 = input("Enter the first name: ")
name2 = input("Enter the second name: ")
name3 = input("Enter the third name: ")
name4 = input("Enter the fourth name: ")
name = [name1, name2, name3, name4]

# Check if names start with 'G'
for letter in name:
    if letter[0]=='G':
        print(letter)

# Check if names end with 'a'
for alphabet in name:
    if alphabet[-1]=='a':
        print(alphabet)

# Check if names contain a space
for alpha in name:
    for space in alpha:
        if space==' ':
            print(alpha)

# Check if names are longer than 9 characters
for character in name:
    if len(character)&amp;gt;9:
        print(character)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Output
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
Enter the first name: Varatharajan&lt;br&gt;
Enter the second name: Guru prasanna&lt;br&gt;
Enter the third name: Lakshmi pritha&lt;br&gt;
Enter the fourth name: Guhanraja&lt;br&gt;
Guru prasanna&lt;br&gt;
Guhanraja&lt;br&gt;
Guru prasanna&lt;br&gt;
Lakshmi pritha&lt;br&gt;
Guhanraja&lt;br&gt;
Guru prasanna&lt;br&gt;
Lakshmi pritha&lt;br&gt;
Varatharajan&lt;br&gt;
Guru prasanna&lt;br&gt;
Lakshmi pritha&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Task
&lt;/h1&gt;

&lt;h1&gt;
  
  
  input
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name = input('enter your name :')
print(name)


for alphabet in name:
    print(alphabet,end=' ')

print()

for alphabet in name:
    print(alphabet,end='*')

print()

for alphabet in name:
    print(alphabet)

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

&lt;/div&gt;



&lt;h1&gt;
  
  
  Output
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;enter your name :varatha&lt;br&gt;
varatha&lt;br&gt;
v a r a t h a&lt;br&gt;
v*a*r*a*t*h*a*&lt;br&gt;
v&lt;br&gt;
a&lt;br&gt;
r&lt;br&gt;
a&lt;br&gt;
t&lt;br&gt;
h&lt;br&gt;
a&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>string in Python</title>
      <dc:creator>varatharajan</dc:creator>
      <pubDate>Tue, 19 Nov 2024 08:37:23 +0000</pubDate>
      <link>https://dev.to/varatha/string-in-python-382b</link>
      <guid>https://dev.to/varatha/string-in-python-382b</guid>
      <description>&lt;p&gt;Strings&lt;br&gt;
Strings in python are surrounded by either single quotation marks, or double quotation marks.&lt;br&gt;
'hello' is the same as "hello".&lt;/p&gt;

&lt;p&gt;You can display a string literal with the print() function:&lt;br&gt;
example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name = 'varatharajan'
name = "varatharajan"
print(name)
print(name)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;result&lt;br&gt;
`&lt;br&gt;
varatharajan&lt;br&gt;
varatharajan&lt;/p&gt;

&lt;p&gt;`&lt;br&gt;
Multiline Strings&lt;/p&gt;

&lt;p&gt;You can assign a multiline string to a variable by using three quotes:&lt;br&gt;
example1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
city = '''Madurai's Jigarthanda is very famous'''
print(city)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;result&lt;br&gt;
&lt;code&gt;Madurai's Jigarthanda is very famous&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;example2:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;address = """3, kosakulam,
          madurai - 17"""

print(address)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;result&lt;/p&gt;

&lt;p&gt;&lt;code&gt;3, kosakulam,&lt;br&gt;
          madurai - 17&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Objects&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Python is an object oriented programming language.&lt;br&gt;
Almost everything in Python is an object, with its properties and methods.&lt;br&gt;
Every object has its own memory space.&lt;br&gt;
In Python, the id() function returns the unique memory address of the object passed to it.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name = 'Varatharajan'
degree = 'Bsc.Phy,'
height = 165
sunday = False
print(id(name))
print(id(degree))
print(id(height))
print(id(sunday))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;result&lt;br&gt;
&lt;code&gt;1855594568496&lt;br&gt;
1855594568304&lt;br&gt;
1855593256304&lt;br&gt;
140732337605512&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;1.String is immutable.&lt;br&gt;
2.String is index-based&lt;br&gt;
3.String starts from 0&lt;/p&gt;

&lt;p&gt;Index/subscript:&lt;/p&gt;

&lt;p&gt;A string is a sequence of characters, so indexing can be used to access individual characters.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name = 'varatharajan'

print(name[0])
print(name[1])
print(name[2])
print(name[3])
print(name[4])
print(name[5])
print(name[6])
print(name[7])
print(name[8])
print(name[9])
print(name[10])
print(name[11])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;result&lt;br&gt;
&lt;code&gt;&lt;br&gt;
v&lt;br&gt;
a&lt;br&gt;
r&lt;br&gt;
a&lt;br&gt;
t&lt;br&gt;
h&lt;br&gt;
a&lt;br&gt;
r&lt;br&gt;
a&lt;br&gt;
j&lt;br&gt;
a&lt;br&gt;
n&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name = 'varatharajan'

print(name[0],end=' ')
print(name[1],end=' ')
print(name[2],end=' ')
print(name[3],end=' ')
print(name[4],end=' ')
print(name[5],end=' ')
print(name[6],end=' ')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;result&lt;br&gt;
&lt;code&gt;&lt;br&gt;
v a r a t h a&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
example 3 :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name = 'varatharajan'

# first letter
print(name[0])
#last letter
print(name[11])
#first letter 'v'
if name[0] == 'v':
    print("yes starts with v")
#last letter 'a'
if name[11] == 'n':
    print("yes ends with n")
#all letters with single space in same line
print(name[0], end=' ')
print(name[1], end=' ')
print(name[2], end=' ')
print(name[3], end=' ')
print(name[4], end=' ')
print(name[5], end=' ')
print(name[6], end=' ')
print(name[7], end=' ')
print(name[8], end=' ')
print(name[9], end=' ')
print(name[10], end=' ')
print(name[11], end=' ')
#middle letter ??

length = len(name) #12

print(name[length//2])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;result&lt;br&gt;
&lt;code&gt;&lt;br&gt;
v&lt;br&gt;
n&lt;br&gt;
yes starts with v&lt;br&gt;
yes ends with n&lt;br&gt;
v a r a t h a r a j a n a&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Programs</title>
      <dc:creator>varatharajan</dc:creator>
      <pubDate>Mon, 18 Nov 2024 03:35:00 +0000</pubDate>
      <link>https://dev.to/varatha/sslc-mark-and-percentage-calculator-program-in-python-30jh</link>
      <guid>https://dev.to/varatha/sslc-mark-and-percentage-calculator-program-in-python-30jh</guid>
      <description>&lt;p&gt;*&lt;em&gt;SSLC mark and percentage calculator program in Python&lt;br&gt;
*&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;tamil = input("Tamil Mark please: ")
english = input("English Mark please: ")
maths = input("Maths Mark please: ")
science = input("Science Mark please: ")
social = input("Social Mark please: ")
result = int(tamil) + int(english) + int(maths) + int(science) + int(social)
print("total mark is:",result)
print("percentage is:",(result)*(100/500),'%')

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

&lt;/div&gt;



&lt;p&gt;result&lt;br&gt;
`&lt;br&gt;
Tamil Mark please: 90&lt;br&gt;
English Mark please: 85&lt;br&gt;
Maths Mark please: 85&lt;br&gt;
Science Mark please: 90&lt;br&gt;
Social Mark please: 90&lt;br&gt;
total mark is: 440&lt;br&gt;
percentage is: 88.0 %&lt;/p&gt;

&lt;p&gt;`&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BMI calculator program in Python&lt;/strong&gt;&lt;/p&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%2Fy245ag3sw0zgkr7ai19i.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%2Fy245ag3sw0zgkr7ai19i.jpg" alt="Image description" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Weight = int(input("Enter your weight: "))
Hight = float(input("Enter your height: "))

def bmiCal(Weight,Height):

    bmi = Weight/float(Height*Height)
    result = ''
    if bmi &amp;lt; 18.50:
        result = 'under weight' 
    elif bmi &amp;gt;=18.50 and bmi &amp;lt;= 24.9:
        result = 'healthy weight'     
    elif bmi &amp;gt;=25 and bmi &amp;lt;= 29.9:
        result = 'over weight'
    elif bmi &amp;gt;=30:
        result = 'obesity'

    return result


print(bmiCal(Weight,Hight))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;result&lt;br&gt;
&lt;code&gt;Enter your weight: 60&lt;br&gt;
Enter your height: 1.65&lt;br&gt;
healthy weight&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;EB calculator&lt;br&gt;
simple calculate&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;units = int(input("Enter no of units consumed :"))
price = int(input("Enter the price per unit : "))



def calculate(units,price):
    return units*price


result = calculate(units,price)

print("Total price is : ",result )

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

&lt;/div&gt;



&lt;p&gt;result&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Enter no of units consumed :100&lt;br&gt;
Enter the price per unit : 3&lt;br&gt;
Total price is :  300&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Day 3 - Python</title>
      <dc:creator>varatharajan</dc:creator>
      <pubDate>Thu, 14 Nov 2024 09:58:47 +0000</pubDate>
      <link>https://dev.to/varatha/day-3-python-527e</link>
      <guid>https://dev.to/varatha/day-3-python-527e</guid>
      <description>&lt;p&gt;**&lt;/p&gt;

&lt;p&gt;Built-in Data Types :&lt;br&gt;
**&lt;br&gt;
In programming, data type is an important concept.&lt;/p&gt;

&lt;p&gt;Variables can store data of different types, and different types can do different things.&lt;/p&gt;

&lt;p&gt;Text Type:  str&lt;br&gt;
Numeric Types:  int, float, complex&lt;br&gt;
Sequence Types: list, tuple, range&lt;br&gt;
Mapping Type:   dict&lt;br&gt;
Set Types:  set, frozenset&lt;br&gt;
Boolean Type:   bool&lt;br&gt;
Binary Types:   bytes, bytearray, memoryview&lt;br&gt;
None Type:  NoneType&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;no1 = 5
print(no1)
print(type(no1))

no2 = ("get a value from user")
print(no2)
print(type(no2))

no3 = 5.5
print(no3)
print(type(no3))

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

&lt;/div&gt;



&lt;p&gt;result&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
5&lt;br&gt;
&amp;lt;class 'int'&amp;gt;&lt;br&gt;
get a value from user&lt;br&gt;
&amp;lt;class 'str'&amp;gt;&lt;br&gt;
5.5&lt;br&gt;
&amp;lt;class 'float'&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Variables :&lt;br&gt;
    Variable is a reserved memory location to store values.&lt;/p&gt;

&lt;p&gt;for example :&lt;/p&gt;

&lt;p&gt;address = " 3, Kosakulam, madurai"&lt;br&gt;
(reference variable&lt;br&gt;
       or &lt;br&gt;
  identifiers)&lt;/p&gt;

&lt;p&gt;= ----&amp;gt; is called Assignment operator&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rules for Python variables:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A variable name must start with a letter or the underscore character&lt;/li&gt;
&lt;li&gt;A variable name cannot start with a number&lt;/li&gt;
&lt;li&gt;A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )&lt;/li&gt;
&lt;li&gt;Variable names are case-sensitive (age, Age and AGE are three different variables)&lt;/li&gt;
&lt;li&gt;Do not use any of Python's reserved keywords (e.g., for, if, while, etc.) as variable names. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;(     1.Name should be meaningful.&lt;br&gt;
bike_no = 1234&lt;br&gt;
      2.Space is not allowed.&lt;br&gt;
bike_no &lt;br&gt;
bikeNo&lt;br&gt;
      3.Number are allowed but not in first place.&lt;br&gt;
age1&lt;br&gt;
      4.No special character is allowed except _ and $ symbol  )&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;return&lt;/strong&gt;&lt;br&gt;
      The return statement is used to exit a function and send a value back to the caller. &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;def add(no1, no2):
    print(no1+no2)
    return no1+no2


def subtract(no1,no2):
    print(no1-no2)
    return no1-no2

def multiply(no1,no2):
    print(no1*no2)

def divide(no1,no2):
    print(no1/no2)


result1 = add(100,50)
result2 = subtract(50,25)
multiply(result1,result2)

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

&lt;/div&gt;



&lt;p&gt;result&lt;br&gt;
150&lt;br&gt;
25&lt;br&gt;
3750&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;pass :&lt;/strong&gt;&lt;br&gt;
The pass statement is used as a placeholder for future code.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def add(no1, no2):
    print(no1+no2)
    return no1+no2

def subtract(no1,no2):
    print(no1-no2)
    return no1-no2

def multiply(no1,no2):
    print(no1*no2)

def divide(no1,no2):
    pass


result1 = add(100,50)
result2 = subtract(50,25)
multiply(result1,result2)
divide(result1,result2)

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

&lt;/div&gt;



&lt;p&gt;result&lt;br&gt;
150&lt;br&gt;
25&lt;br&gt;
3750&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Day 2 in Python</title>
      <dc:creator>varatharajan</dc:creator>
      <pubDate>Tue, 12 Nov 2024 18:46:52 +0000</pubDate>
      <link>https://dev.to/varatha/day-2-in-python-3m60</link>
      <guid>https://dev.to/varatha/day-2-in-python-3m60</guid>
      <description>&lt;p&gt;&lt;strong&gt;Function :&lt;/strong&gt;&lt;br&gt;
      A function is a block of code which only runs when it is called. You can pass data, known as parameters, into a function.&lt;/p&gt;

&lt;p&gt;There are two types of function in python.&lt;br&gt;
      Built-in library function (pre-defined function)&lt;br&gt;
      User-defined function&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Built-in library function: *&lt;/em&gt;&lt;br&gt;
         There are Standard functions in Python that are available to use.&lt;/p&gt;

&lt;p&gt;for Example :&lt;br&gt;
      input()&lt;br&gt;
      print()&lt;/p&gt;

&lt;p&gt;&lt;em&gt;input() function :&lt;/em&gt;&lt;br&gt;
      The input() function allows user input.&lt;br&gt;
   for example :&lt;br&gt;
       x = input("Enter your name : ") &lt;/p&gt;

&lt;p&gt;&lt;em&gt;print() function&lt;/em&gt;&lt;br&gt;
       The print() function prints the specified message to the screen, or other standard output device.&lt;br&gt;
    for example&lt;br&gt;
        print("welcome to our class")&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User-defined function:&lt;/strong&gt;&lt;br&gt;
      We can create our own functions based on our requirements.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We can define a function in Python, using the def keyword. We can add any type of functionalities and properties to it as we require. &lt;/p&gt;
&lt;/blockquote&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;A = int(input("Enter your A value : "))
B = int(input("Enter your B value : "))
C = input("Enter your operator : ")

def calculate(A,B,C):
  if C == '+':
    print("Addition---&amp;gt;",A+B)
  if C == '-':
    print("subtraction----&amp;gt;",A-B)

calculate(A,B,C)

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

&lt;/div&gt;



&lt;p&gt;*&lt;em&gt;Result *&lt;/em&gt;&lt;br&gt;
Enter your A value10&lt;br&gt;
Enter your B value20&lt;br&gt;
Enter your operator+&lt;br&gt;
Addition---&amp;gt;30&lt;br&gt;
Enter your A value20&lt;br&gt;
Enter your B value10&lt;br&gt;
Enter your operator-&lt;br&gt;
subtraction----&amp;gt;10&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
