Sunday, January 5, 2020

pyramid pattern

PYRAMID PATTERN USING FOR LOOP IN PYTHON LANGUAGE

-5 JANUARY 2020

CONCEPT:

The below program prints the pyramid pattern using * by for loop.

INPUT:

Enter the no of rows:4

PROGRAM:

num=int(input("Enter the no rows:"))
for i in range (0,num):
      for j in range(0, num-i-1):
           print (end=" ")
for j in range(0,i+1):
           print("*",end=" ")
print()

OUTPUT:

       

Friday, January 3, 2020

REGULAR EXPRESSION

REGULAR EXPRESSION using PYTHON
-january 4.1.2020

CONCEPT:
     To get the year from the e-mail id using \d+.
SYMBOL:
\d  - digit(match digit)
\w - specific alphanumeric
\s - space(count the no of space
\.   - each single characters
 - 1..............infinity
 - 0.............infinity
?   - (+91)(Eg: 91  is optional number may be)

INPUT:
     Given Email Id (2000lathaammu2020@gmail.com)
OUTPUT:
     if your input email id is 2000lathaammu2020@gmail.com then your output is ['2000','2020']

PROGRAM:

     for PYTHON..........

import re
s="2000lathaammu2020@gmail.com"
re.findall('\d+',s)


...................................................................................................................................................................