Showing posts with label Basic Python. Show all posts
Showing posts with label Basic Python. Show all posts

Sunday, January 6, 2019

Advance Python Certification online 2019

January 06, 2019 15


Learn Python Like a Professional! Take You from 0 to Hero






In this lecture, will over the process of Advance Python Certification.

This section Includes three sections:

Step 1. Revise the Previous Lecture & Get the Free Python Certificate


Step 2. Problem Solving Challenges 
  • Go ahead and open the browser
  • Once the Page gets loaded, you will see a Sign-up & code option.


  • Click on Signup & code button, it will show you sign up form
Enter the First name & last name, E-mail Password and click on the Create An Account button.


  • Choose Python3 option. It will take you to the first challenge.
  • Now In this exercise, you need to return the sum of a+b and run the code. 

  • Now click on continue option, will ask about your professional status 


  • Select the Professional Status, let's say Student &  Passing year, 2019. Click on Proceed to a dashboard.




  • Here is your dashboard, under problem-solving form click on continue Practice. 




  • You will see the list of all the available challenges. Solve the problems till Kingdom Connectivity.


Step 3. Write Email & Send it to- sn.gurukul24.7uk@gmail.com

            In this Mail, you have to write:

  • Write your Full Name.
  • Append Image of free python certificate
  • Append Hankerrank Profile link

Once we receive your mail application, will start the validation process. It might take 2 to 3 days.
If we find the application is genuine, will issue the advance Python certificate by S.N Gurukul.




In the next Blog, we will start  Data Science Ninja  Bootcamp. 

https://sngurukuls247.blogspot.com/2018/09/python-ninja-bootcamp-1-course.html

                                                                                                                                                          

Follow the link below to access Free Python Lectures-
https://www.youtube.com/sngurukul

Feel free contact me on-

Email - sn.gurukul24.7uk@gmail.com




Saturday, January 5, 2019

Free Python Certification online 2019

January 05, 2019 13

Learn Python Like a Professional! Take You from 0 to Hero






In this Python Lecture, will cover the Process of Free Python Certification


This section includes two sections:


Step 1. Revise Previous Python Lecture
  • Go to ahead and open up the browser
  • Once the page gets loaded, you see a Python Option.
SN Gurukul official site
  • Click on Python Option in the menu bar, it will show the dropdown list with all Python lectures.


Step 2. Install SoloLearn Application

  • Go ahead and open the Google Play
  • Type SoloLearn Application
SoloLearn Application
  • Click on the Install button, to start the download

  • Once the installation gets completed,
Create the New Account & enter the Email, Name, and Password.

  • Click on the start learning button. It will show you the list of all Programming language.

  • Select Python3 option to start Course. It will the available modules.


  • Solve each chapter and unlock all the levels


  • After solving the modules, click on Certificate Option.

  • Click on the Save button and it will store the Python Certificate in your mobile gallery.


  • Here is My Python Certificate



So, Students what are you waiting for, install the app and get the free python certificate.




In the next Blog, we will discuss  Advance Python Certification 
https://sngurukuls247.blogspot.com/2019/01/advance-python-certification-online-2019.html

                                                                                                                                                            

Follow the link below to access Free Python Lectures-
https://www.youtube.com/sngurukul

Feel free contact me on-

Email - sn.gurukul24.7uk@gmail.com

Saturday, December 29, 2018

Python Ninja Bootcamp 41- Q&A 7th

December 29, 2018 0

Learn Python like a Professional! Take You from 0 to Hero






In this Python lecture, we will learn about the  Q&A 7th


Q. Write the Program to count the occurrence of a number in the digit given by the user
Example: 
111122233333


Output: 
1 occur 4-times
2 occur 3-times
3 occur 5-times


num=input('Enter the digit =')
>> Enter the digit = 111122233333

from collections import Counter

for key,value in Counter(list(num)).items():
    print('{x} occur {y}-times'.format(x=key,y=value))
>>1 occur 4-times
2 occur 3-times
3 occur 5-times

Q. Write a program to remove the punctuation marks from the string given by the user

Example: Hi guys, welcome back to python ninja bootcamp. Let's get started!

Output: Hi guys welcome back to python ninja bootcamp Let s get started


import re
pattern='\w+'
string=input('Enter the string = ')
>>Enter the string = Hi guys,welcome back to python ninja bootcamp. Let's get started!

' '.join(re.findall(pattern,string))
>> 'Hi guys welcome back to python ninja bootcamp Let s get started'


Q.Write a program to extract the Email id from the string given by the user.

Example: Please contact sn.gurukul24.7uk@gmail.com for assistance
Output: sn.gurukul24.7uk@gmail.com

import re
pattern='[\w\.-]+@[\w\.-]+' #[\w\.-]+ matches one or more aplha numeric, dot or dash
string=input('Enter the string = ')
>> Enter the string = Please contact sn.gurukul24.7uk@gmail.com for assistance

re.search(pattern,string).group()
>> 'sn.gurukul24.7uk@gmail.com'



EDITS ARE WELCOMED!!

In the next Blog, we will discuss Free Python Certification  

https://sngurukuls247.blogspot.com/2019/01/free-python-certification-online.html

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

Follow the link below to access Free Python Lectures-
https://www.youtube.com/channel/UCENc9qI7_r8KMf6-_1R1xnw

Instagram-
https://www.instagram.com/python.india/

View the Jupyter Notebook for this lecture

Download the Jupyter Notebook for this lecture 



Feel free contact me on-
Email - sn.gurukul24.7uk@gmail.com

Friday, December 28, 2018

Python Ninja Bootcamp 40-Regular expression

December 28, 2018 0

Learn Python like a Professional! Take You from 0 to Hero






In this Python lecture, we will learn about the Regular Expression.

"Regular expression is a sequence of characters that forms a search pattern
Python has a built-in package called,re module which can be used to work with Regular Expressions."

Important methods in Regex

1. match( )
Takes a pattern and string as parameter. It applies the pattern at the beginning of the string & returns the match object if found or None if not found  

Let see an example-

In order to work with regular expression, we need to import re

import re

pattern='python'
string='python ninja bootcamp'
if re.match(pattern,string):
    print('Match is found')
else:
    print('No Match is found')
>>Match is found

pattern='python'
string='Welcome to python ninja bootcamp'
if re.match(pattern,string):
    print('Match is found')
else:
    print('No Match is found')
>>No Match is found

2. search( )

takes a pattern and string as a parameter. It matches the pattern anywhere in the string & returns the object if found or None if not found  

pattern='python'
string='Welcome to python ninja bootcamp'
if re.search(pattern,string):
    print('Match is found')
else:
    print('No Match is found')
>>Match is found

3. findall( )


Takes a pattern and string as a parameter. It returns the list of all substrings that match a pattern. 

pattern='python'
string='python111python222python333'
re.findall(pattern,string)
>> ['python', 'python', 'python']

Metacharacters

Metacharacters are the building block of a regular expression, characters having some important meaning.

Important Metacharacter

1. dot 
. matches with any character, other than \n.

pattern='b.t'
string='bat_bet_bot_but_b\nt'
re.findall(pattern,string)
>> ['bat', 'bet', 'bot', 'but']


2. Asterisks
* matches with zero or more occurrence of a character.


pattern='ab*'
string='a_ab_abbb_abc_b'
re.findall(pattern,string)
>>['a', 'ab', 'abbb', 'ab']



3. Plus
matches with one or more occurrence of a character.


pattern='ab+'
string='a_ab_abbb_abc_b'
re.findall(pattern,string)
>> ['ab', 'abbb', 'ab']


4. Question Mark
? matches with zero or one occurrence of a character.


pattern='ab?'
string='a_ab_abbb_abc_b'
re.findall(pattern,string)
>>['a', 'ab', 'ab', 'ab']


5. Curly Bracket
{} matches with the number defined inside it.

pattern='ab{3}'
string='a_ab_abbb_abc_b'
re.findall(pattern,string)
>> ['abbb']


6. Caret
matches pattern at the beginning of the string.


pattern='^ab'
string='abcd'
bool(re.search(pattern,string))
>> True

7. Dollar
matches the pattern at the beginning of the string.


pattern='cd$'
string='abcd'
bool(re.search(pattern,string))
>> True

Character Set in Regex.


Character set matches only one out of several characters
It is defined by putting the character in the [ ].

pattern='b[aeiou]t'
string='bat'
bool(re.search(pattern,string))
>> True

pattern='b[aeiou]t'
string='bot'
bool(re.search(pattern,string))
>> True

pattern='b[aeiou]t'
string='bxt'
bool(re.search(pattern,string))
>> False


Caret & Character set
Caret inside [ ] excludes all the character defined inside it

pattern='b[^aeiou]t'
string='bxt'
bool(re.search(pattern,string))
>> True

pattern='b[^aeiou]t'
string='bxt'
bool(re.search(pattern,string))
>> False


Range & Character Set
Describe the range of character and numbers in character set.

pattern='[A-Z][0-9]'
string='A1'
bool(re.search(pattern,string))
>> True

pattern='[A-Z][0-9]'
string='A+'
bool(re.search(pattern,string))

>> False


Some Special Sequence

\d : for digit 

pattern='\d+'
string='Welcome to #Python Ninja Bootcamp 007. Lets get started'
re.findall(pattern,string)
>>['007']


\D : for non-digit 

pattern='\D+'
string='Welcome to #Python Ninja Bootcamp 007. Lets get started'
re.findall(pattern,string)
>>['Welcome to #Python Ninja Bootcamp ', '. Lets get started']



\s : for white space 


pattern='\s+'
string='Welcome to #Python Ninja Bootcamp 007. Lets get started'
re.findall(pattern,string)
>>[' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']



\S : for non-white space 


pattern='\S+'
string='Welcome to #Python Ninja Bootcamp 007. Lets get started'
re.findall(pattern,string)
>>['007']




\w : for alphanumeric


pattern='\w+'
string='Welcome to #Python Ninja Bootcamp 007. Lets get started'
re.findall(pattern,string)
>>['Welcome','to','#Python','Ninja','Bootcamp','007.','Lets','get','started']


\W : for non- alphanumeric

pattern='\W+'
string='Welcome to #Python Ninja Bootcamp 007. Lets get started'
re.findall(pattern,string)
>>[' ', ' #', ' ', ' ', ' ', '. ', ' ', ' ']




EDITS ARE WELCOMED!!

In the next Blog, we will discuss Q&A Seventh  

https://sngurukuls247.blogspot.com/2018/12/python-ninja-bootcamp-41-q-7th.html

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

Follow the link below to access Free Python Lectures-
https://www.youtube.com/channel/UCENc9qI7_r8KMf6-_1R1xnw

Instagram-
https://www.instagram.com/python.india/

View the Jupyter Notebook for this lecture

Download the Jupyter Notebook for this lecture 



Feel free contact me on-
Email - sn.gurukul24.7uk@gmail.com

Saturday, December 22, 2018

Python Ninja Bootcamp 39-Counter function

December 22, 2018 0

Learn Python like a Professional! Take You from 0 to Hero






In this Python lecture, we will learn about the Python Counter function

"Counter is a function within collections module. It returns the occurrence of the elements "


Counter() in python        

Let's see some example-

from collections import Counter


s='aaaaabbbccdddaa'
Counter(s)
>>Counter({'a': 7, 'b': 3, 'c': 2, 'd': 3}) 

l=[1,1,1,2,2,3,3,3,3,3,3,4,4,4,5,5,5,5,2,2]
Counter(l)
>> Counter({1: 3, 2: 4, 3: 6, 4: 3, 5: 4})

t=(1,1,1,2,2,3,3,3,3,3,3)
Counter(t)
>> Counter({1: 3, 2: 2, 3: 6})



EDITS ARE WELCOMED!!

In the next Blog, we will discuss regular expression

https://sngurukuls247.blogspot.com/2018/12/python-ninja-bootcamp-40-regular.html

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

Follow the link below to access Free Python Lectures-
https://www.youtube.com/channel/UCENc9qI7_r8KMf6-_1R1xnw

Instagram-
https://www.instagram.com/python.india/

View the Jupyter Notebook for this lecture

Download the Jupyter Notebook for this lecture 




Feel free contact me on-
Email - sn.gurukul24.7uk@gmail.com

Wednesday, December 19, 2018

Python Ninja Bootcamp 38-Q&A 6th

December 19, 2018 0

Learn Python like a Professional! Take You from 0 to Hero






In this Python lecture, we will learn about the Q&A 6th.


Answer the following Question-

    Q. Write one line of code to return the prime numbers between 0 to 100 by using map function and filter function.

     

    print(*list(filter(lambda num:num ,list(map(lambda num:num if all(num%i!=0 for i in range(2,num)) else None,range(2,101))))),sep=',')
    
    >>2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97


    Q. Write a code to aggregate each word and its length in the given sentence-'Welcome to Python Ninja Bootcamp' by using map function and zip function.


    l='Welcome to Python Ninja Bootcamp'.split(' ')
    print(tuple(zip(l,list(map(len,l)))))
    
    
    
    >>(('Welcome', 7), ('to', 2), ('Python', 6), ('Ninja', 5), ('Bootcamp', 8))


    Q. Write code to tag counter (1-26) to the alphabets(a-z) by using enumerate function


    Ist Method
    import string 
    d={}
    for counter,value in enumerate(list(string.ascii_lowercase)):
         d[counter +1]=value
            
    print(d)
    
    >>{1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j', 11: 'k', 12: 'l', 13: 'm', 14: 'n', 15: 'o', 16: 'p', 17: 'q', 18: 'r', 19: 's', 20: 't', 21: 'u', 22: 'v', 23: 'w', 24: 'x', 25: 'y', 26: 'z'}
    
    

    IInd method
    import string 
    
    print(dict(enumerate(string.ascii_lowercase,1)))
    
    >>{1: 'a', 2: 'b', 3: 'c', 4: 'd', 5: 'e', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 10: 'j', 11: 'k', 12: 'l', 13: 'm', 14: 'n', 15: 'o', 16: 'p', 17: 'q', 18: 'r', 19: 's', 20: 't', 21: 'u', 22: 'v', 23: 'w', 24: 'x', 25: 'y', 26: 'z'}
    
    

    EDITS ARE WELCOMED!!

    In the next Blog, we will discuss Python Module.  

    https://sngurukuls247.blogspot.com/2018/12/python-ninja-bootcamp-39-counter.html

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

    Follow the link below to access Free Python Lectures-
    https://www.youtube.com/channel/UCENc9qI7_r8KMf6-_1R1xnw

    Instagram-
    https://www.instagram.com/python.india/


    View the Jupyter Notebook for this lecture

    Download the Jupyter Notebook for this lecture 




    Feel free contact me on-


    Monday, December 17, 2018

    Python Ninja Bootcamp 37-all & any function

    December 17, 2018 0

    Learn Python like a Professional! Take You from 0 to Hero






    In this Python lecture, we will learn about the all() & any()

    "all is the function that takes a sequence as a parameter, return
    • True- if all elements in a sequence are true or if a sequence is empty.
    • False- if any element in a sequence is false."  

    "any is the function that takes a sequence as a parameter, return
    • True- if at least one element of a sequence is true.
    • False- if all elements in a sequence are false or if a sequence is empty."

    Python all( ) & any( )

    Let's see the example 


    all([True,True,True])
    >> True

    all([True,True,False])
    >>False

    any([False,False,False])
    >>False

    any([False,False,True])
    >>True





    EDITS ARE WELCOMED!!

    In the next Blog, we will discuss Q&A 6th  

    https://sngurukuls247.blogspot.com/2018/12/python-ninja-bootcamp-38-q-6th.html

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

    Follow the link below to access Free Python Lectures-
    https://www.youtube.com/channel/UCENc9qI7_r8KMf6-_1R1xnw

    Instagram-
    https://www.instagram.com/python.india/

    View the Jupyter Notebook for this lecture

    Download the Jupyter Notebook for this lecture 



    Feel free contact me on-
    Email - sn.gurukul24.7uk@gmail.com

    Sunday, December 16, 2018

    Python Ninja Bootcamp 36-Enumerate function

    December 16, 2018 0

    Learn Python like a Professional! Take You from 0 to Hero






    In this Python lecture, we will learn about the Enumerate( ).

    "Enumerate is the function that takes a sequence as a parameter & adds a counter to elements, returns it in a form of enumerate object ".

    Python Enumerate function

    Let's see the some example

    tuple(enumerate([1,2,3,4,5]))
    >> ((0, 1), (1, 2), (2, 3), (3, 4), (4, 5))

    In this example, the list elements get paired along with counter

    for count,value in enumerate((1,2,3,4,5)):
        if count>2:
            print(value)
    >>4
        5

    In this example, a counter is used to print the element of the tuple.



    EDITS ARE WELCOMED!!

    In the next Blog, we will discuss all() & any()  

    https://sngurukuls247.blogspot.com/2018/12/python-ninja-bootcamp-37-all-any.html

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

    Follow the link below to access Free Python Lectures-
    https://www.youtube.com/channel/UCENc9qI7_r8KMf6-_1R1xnw

    Instagram-
    https://www.instagram.com/python.india/

    View the Jupyter Notebook for this lecture

    Download the Jupyter Notebook for this lecture 



    Feel free contact me on-
    Email - sn.gurukul24.7uk@gmail.com

    Thursday, December 13, 2018

    Python Ninja Bootcamp 35-Zip function

    December 13, 2018 0

    Learn Python like a Professional! Take You from 0 to Hero






    In this Python lecture, we will learn about the Zip( ).

    "Zip is the function that takes the sequences as a parameter and aggregates their elements on each pass. "

    Python Zip function

    Let's see the example

    tuple(zip((1,2,3),(4,5,6)))
    >> ((1,4),(2,5),(3,6))

    We can also insert list along with tuple

    tuple(zip((1,2,3),(4,5,6),[7,8,9]))
    >>  ((1,4,7),(2,5,8),(3,6,9))


    Now let's find the greatest number from zip pair.

    for pair in zip((1,2,3),(0,5,4)):
        print(max(pair))
    >>1
        5
        4


    EDITS ARE WELCOMED!!

    In the next Blog, we will discuss Enumerate  

    https://sngurukuls247.blogspot.com/2018/12/python-ninja-bootcamp-36-enumerate.html

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

    Follow the link below to access Free Python Lectures-
    https://www.youtube.com/channel/UCENc9qI7_r8KMf6-_1R1xnw

    Instagram-
    https://www.instagram.com/python.india/

    View the Jupyter Notebook for this lecture

    Download the Jupyter Notebook for this lecture 



    Feel free contact me on-
    Email - sn.gurukul24.7uk@gmail.com