Skip to main content

LEARNING CONTENT FOR PYTHON IN TAMIL

Hi guys welcome to Tamil Hacks!!






    Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and first released in 1991, Python's design philosophy emphasizes code readability with its notable use of significant whitespace. 
    Python is a beautiful language. It’s easy to learn and fun, and its syntax is simple yet elegant. Python is a popular choice for beginners, yet still powerful enough to back some of the world’s most popular products and applications from companies like NASA, Google, Mozilla, Cisco, Microsoft, and Instagram, among others. Whatever the goal, Python’s design makes the programming experience feel almost as natural as writing in English.

Here is all the coding’s used in the course during the video.
# Numbers 
# integers 1 2 3 4 5 
# float 1.2 5.6 9.5 10.50 
# complex 5+2j 
print(3 // 2) 
# - * / + ** % 
-----------------------------------------------------------------------------------------
# variables , a-z , _ , watch , Watch 
Watch_price = 500 
Customer_Name = "karthik" 
Watch1 = Name
1 = 750 
print(Watch_price) 
print(Customer_Name) 
-----------------------------------------------------------------------------------------
# strings 
word = 'Hi' 
word2 = " my age is 24 , why can't i vote " 
para = """ this is my para """ 
word3 = "hello, world" 
-----------------------------------------------------------------------------------------
# slicing , length , strip() 
print(word3[-5:-1]) 
print(len(para)) 
print(word2.strip()) 
print(word.lower()) 
print(word.upper()) 
a = 'raj' 
print(a.replace('j', 'ju')) 
print(a.split('a')) 
print("hew" in word3) 
a1 = 'hi' 
a2 = ' karthik' 
print(a1 + a2) 
-----------------------------------------------------------------------------------------
# Boolean 
print(1 == 1) 
# operators 
# arthimetic 
# = 
# > < >= <= 
# and or not 
# is is not
# in not in 
# & | ^ ~ << >> 
number1 = 10 
number1 /= 10 
number2 = number1 + 20 
-----------------------------------------------------------------------------------------
# casting 
a = float(10) 
b = int(10.10) 
c = str(120) 
print(a, b, c) 
-----------------------------------------------------------------------------------------
# type 
d = "h3"
print(type(d)) 
-----------------------------------------------------------------------------------------
# list 
fruits = ['apple', 'orange', 'cherry'] 
fruits[1] = 'banana' 
fruits.append("new") 
print(fruits) 
number = [11, 2, 20, 0] 
number.sort(reverse=True) 
print(number) 
add = fruits + number 
print(add) 
-----------------------------------------------------------------------------------------
# Tuples 
fruits = ('apple', 'orange', 'cherry') 
print(fruits) 
number = (11, 2, 20, 0) 
print(number) 
add = fruits + number 
print(add) 
-----------------------------------------------------------------------------------------
# Dictionary , get() 
my_data = { "name": "karthik", "age": "24" } 
# my_data["age"] = "25" 
print(my_data.get("age")) 
-----------------------------------------------------------------------------------------
# if statements 
age = 18 
if age > 18: 
    print("you can vote in election") 
elif age == 18: 
    print("apply for vote id") 
else: 
    print("you have to wait till 18") 
a, b = 10, 20
if a == 10 or b == 20: 
    # and , or nesting of if 
   print("correct") 
   if b == 20: 
         print("hi") 
   else: 
        print("incorrect") 
-----------------------------------------------------------------------------------------
# functions def 
def addition(a, b): 
    print(a + b) 
def subtraction(a, b): 
    print(a - b) 
def hi(name): 
    print("Hi," + name) 
def fun(a): 
    return a*100 

addition(12, 10) 
addition(100, 300) 
subtraction(50, 25) 
hi("balu") 
print(fun(5)) 
-----------------------------------------------------------------------------------------
# loops 
name = 'karthik' 
# for loop 
for letters in name: 
    print(letters) 
fruits = ['apple', 'orange', 'banana'] 
for fruit in fruits: 
    print(fruit) 
for i in "hi, welcome": 
    if i == ',': 
# continue 
        print(", is present") 
# break 
    else: 
        print(", is not present") 
#range 5 - 0,1,2,3,4 
for number in range(10, 30, 4): 
    print(number) 
for number in range(5): 
    print(number) 
for i in range(2): 
    print(i) 
else: 
     print('all numbers are finished') 
-----------------------------------------------------------------------------------------
# loops while 
i = 1 
while i < 5: 
# 5 < 5  
    print(i) i += 1 
else: 
    print("over") 
-----------------------------------------------------------------------------------------
# Lambda 
add_5 = lambda number: number + 10 
print(add_5(25)) 
print(add_5(120)) 
-----------------------------------------------------------------------------------------
# input
number1 = float(input('enter number1')) 
number2 = int(input('enter number2')) 
print(number1 + number2) 
name = input("type your name") 
print("my name is " + name) 
-----------------------------------------------------------------------------------------
# simple calculator 
def add(a, b): 
    return a+b 
def sub(a, b): 
    return a-b 
def mul(a, b): 
    return a-b 
def div(a, b): 
    return a//b 
print("""Select operation 
1.add 
2.sub 
3.mul 
4.div
""") 
choice = int(input("enter your choice")) 
a = int(input("enter number 1")) 
b = int(input("enter number 2")) 

if choice == 1: 
    print(add(a, b)) 
elif choice == 2: 
    print(sub(a, b)) 
elif choice == 3: 
    print(mul(a, b)) 
elif choice == 4: 
    print(div(a, b)) 
else: 
    print("enter correct choice") 
# final task answer print() 
print('Hi, I can code in Python!') 
print(''' 
My favourite animal is dog 
o-###-
    | |  # 
This is my home 
    _ | 
    |      | 
    |#    |____ 
    |      |        | 
    | #   | #     |
  _|___|_#__|_ 
Now Puzzle time 
''') 
born = input('What year were you born?') 
born = int(born) 
age = 2025 - born 
print('In the year 2025 you\'ll be', age, 'years old!') 

Numbers 
    Python has integers and floats. Integers are simply whole numbers, like 314, 500, and 716. Floats, meanwhile, are fractional numbers like 3.14, 2.867, 76.88887. You can use the type method to check the value of an object. 
    >>> type(3) 
    >>> type(3.14) 
    >>> pi = 3.14 
    >>> type(pi) 
 In the last example, pi is the variable name, while 3.14 is the value. You can use the basic mathematical operators: 
        >>> 3 + 3 
                6
        >>> 3 - 3 
                0
        >>> 3 / 3
                1.5 
        >>> 3 * 3 
                9
        >>> 3 ** 3 
                27  
        >>> num = 3 
        >>> num = num - 1 
        >>> print(num)  
                2 
        >>> num = num + 10 
        >>> print(num)  
                12 
        >>> num += 10  
        >>> print(num) 
                22  
        >>> num -= 12 
        >>> print(num)      
                10 
        >>> num *= 10 
        >>> num 
                100 
    There’s also a special operator called modulus, , that returns the remainder after integer division. 
        >>> 10%3
                1 
   One common use of modulus is determining if a number is divisible by another number. For example, we know that a number is even if it’s divided by 2 and the remainder is 0.  
        >>> 10%2
                0 
        >>> 12%2
               
Finally, make sure to use parentheses to enforce precedence. 
        >>> (2+3)*5
                25 
        >>> 2+3*5
                17 
 
Strings 
    Strings are used quite often in Python. Strings, are just that, a string of characters - which s anything you can type on the keyboard in one keystroke, like a letter, a number, or a backslash. Python recognises single and double quotes as the same thing, the beginning and end of the strings. 
        >>> "string list" 
                'string list' 
        >>> 'string list' 
                'string list' 
What if you have a quote in the middle of the string? Python needs help to recognise quotes as part of the English language and not as part of the Python language. 
        >>> "I ’cant do that" 
                'I ’cant do that'
        >>> "He said \"no\" to me" 
                'He said "no" to me' 
Now you can also join (concatenate) strings with use of variables as well. 
        >>> a = "first" 
        >>> b = "last" 
        >>> a + b 
                'firstlast' 
If you want a space in between, you can change a to the word with a space after.
        >>> a = "first " 
        >>> a + b 
                'first last'  
There are different string methods for you to choose from as well - like upper(), lower(), replace(), and count(). upper()does just what it sounds like - changes your string to all uppercase letters. 
        >>> str = 'woah!' 
        >>> str.upper() 
                'WOAH!'
Can you guess what lower() does? 
        >>> str = 'WOAH!' 
        >>> str.lower() 
                'woah!' 
replace()allows you to replace any character with another character. 
        >>> str = 'rule'     
        >>> str.replace('r', 'm') 
                'mule' 
Finally, count()lets you know how many times a certain character appears in the string. 
        >>> number_list =['one', 'two', 'one', 'two', 'two'] 
        >>> number_list.count('two') 
                3
You can also format/create strings with the format() method. 
        >>> "{0} is a lot of {1}".format("Python", "fun!")
                'Python is a lot of fun!' 

Booleans 
Boolean values are simply True or False . 
Check to see if a value is equal to another value with two equal signs. 
        >>> 10 == 10 
                True 
        >>> 10 == 11 
                False 
        >> "jack" == "jack" 
                True 
To check for inequality use !=. 
        >>> 10 != 10 
                False 
        >>> 10 != 11 
                True 
        >>> "jack" != "jack" 
                False
You can also test for > , < , >= , and <=. 1 
        >>> 10 > 10 
                False 
         >>> 10 < 11 
                 True 
         >>> 10 >= 10 
                 True 
         >>> 10 <= 11 
                 True 
         >>> 10 <= 10 < 0 
                  False
         >>> 10 <= 10 < 11 
                 True 
         >>> "jack" > "jack" 
                  False 
        >>> "jack" >= "jack" 
                  True

Lists 
    Lists are containers for holding values. 
        >>> fruits = ['apple','lemon','orange','grape'] 
        >>> fruits
To access the elements in the list you can use their associated index value. Just remember that the list starts with 0, not 1. 
        >>> fruits[2] 
                'orange '
If the list is long and you need to count from the end you can do that as well.
        >>> fruits[-2]
                 'orange ' 
Now, sometimes lists can get long and you want to keep track of how many elements you have in your list. To find this, use the len() function. 
        >>> len(fruits) 
                
Use append() to add a new element to the end of the list and pop() to remove an element from the end. 
        >>> fruits.append('blueberry') 
        >>> fruits
                ['apple', 'lemon', 'orange', 'grape', 'blueberry'] 
        >>> fruits.append('tomato') 
        >>> fruits
                ['apple', 'lemon', 'orange', 'grape', 'blueberry', 'tomato'] 
Check to see if a value exists using in the list. 
        >>> 'apple' in fruits 
                True 
        >>> 'banana' in fruits 
                False
Dictionaries 
    A dictionary optimizes element lookups. It uses key/value pairs, instead of numbers as placeholders. Each key must have a value, and you can use a key to look up a value.
        >>> words = {'apple': 'red','lemon': 'yellow'} 
        >>> words 
                {'apple': 'red','lemon': 'yellow'} 
        >>> words['apple'] 
                'red' 
This will also work with numbers. 
        >>> dict = {'one': 1, 'two': 2} 
        >>> dict
                {'one': 1, 'two': 2} 
Output all the keys with keys() and all the values with values(). 
        >>> words.keys() 
                dict_keys(['apple', 'lemon']) 
        >>> words.values() 
                dict_values(['red', 'yellow'])

IF Statements 
    The IF statement is used to check if a condition is true. Essentially, if the condition is true, the Python interpreter runs a block of statements called the if-block. If the statement is false, the interpreter skips the if block and processes another block of statements called the else-block. The else clause is optional. Let’s look at two quick examples. 
        >>> num = 20 
        >>> if num == 20: 
                        print('the number is 20')  
                else: 
                        print('the number is not 20') 
                    the number is 20 
You can also add an elif clause to add another condition to check for. 
         >>> num = 21 
        >>> if num == 20:
                        print('the number is 20') 
                elif num > 20:
                         print('the number is greater than 20') 
                else: 
                        print('the number is less than 20')
                        the number is greater than 20

Loops 
    There are 2 kinds of loops used in Python - the for loop and the while loop. for loops are traditionally used when you have a piece of code which you want to repeat n number of times. They are also commonly used to loop or iterate over lists. 
        >>> colors = ['red', 'green', 'blue'] 
        >>> colors ['red', 'green', 'blue'] 
        >>> for color in colors: 
                         print('I love ' + color)
while loops, like the for Loop, are used for repeating sections of code - but unlike a for loop, the while loop continues until a defined condition is met.
        >>> num = 1 
        >>> num  
        >>> while num <= 5:  
                        print(num)   
                        num += 1 
                1
                3
                4
                5

Functions 
    Functions are blocks of reusable code that perform a single task. You use def to define (or create) a new function thenyou call a function by adding parameters to the function name.
        >>> def multiply(num1, num2):
                      return num1 * num2 
        >>> multiply(2, 2)
                4
You can also set default values for parameters. 
        >>> def multiply(num1, num2=10): 
                        return num1 * num2 
        >>> multiply(2) 
                20



Comments

  1. I dont have Gpay or phonepe. I want to pay you by RuPay. How to pay.
    Thanks.

    ReplyDelete
  2. nanri nanba to give chance for poor peolpe too see freely


    ReplyDelete
    Replies
    1. Bro u teaching is too good bro.first of all I am weak in python .I am biology student in 12 th.now when I saw your videos.i think I am going to be a computer science student.python next video bro soon bro....
      LOVE u bro......

      Delete
  3. Super teaching. Easy understandable. Thank you

    ReplyDelete
  4. In what way phyton used in IIOT. Pls explain

    ReplyDelete
  5. Vera maari teaching bro❤️🔥

    ReplyDelete

Post a Comment

Popular posts from this blog

Get Ethical Hacking Project #1

Thanks for your interest in our course This is a paid course, 150 rs for Indian people, 5$ for international people Instructions to get course: Indian people can get the course by paying using this UPI id   tamilhacks@ybl  (KARTHIKEYAN T) send 150 Rs to this upi id with subject bug bounty and after payment take a screenshot and send that to email id tamilhackstech@gmail.com - you will get the course within 24 hours. (there will be no tax, when paying using upi id)     The above mentioned method is most preferable. if you don't have a upi id app, install  phonepe  or  google pay   app and register there and pay easily  or  pay here using the alternate method to get this course, this link cost 18% gst for the course . (nearly 30-100 Rs for tax and other charges here )   After payment you will receive a payment confirmation mail along with a downlink for the course, you can download the course file using that . the course is in zip format, so after downloading the file extra

Learn c++ in Tamil | Complete guide and tutorial | Beginner to Advance all concepts explained.

hi guys welcome , all the coding used in video are available here : /* hi guys welcome to learn c++ in tamil what is C++ how what software your own program schools,clg,institute.... start 1.interest 2.patience 3.fun 4.practise computer program - app - programming source code - hardware - fb running , executing machine language :  101010 assembly lang : mov h1; high lang : c , c++....java , js , python  eg :  a+b .....1001010  compiler :  human to machine              machine to human  rules :  a+b;  usage:  games, manufacturing , embedded , finance , graphics , etc...  Guide: 1.problem 2.solution - alternative 3.program  - C++ 4.compile  - turboc , ide , codeblocks , cmd 5.result   - library file - linker : #include<iostream.h>    input , output std::cout<<"welcome";   standard character out << " "; primary section : 1.statements   ;  end 2.functions   main() 3.syntax  , syntax error pra

Get Bug Bounty Course

Thanks for your interest in our course Limited Offer This is a paid course, Rs 10000 ,Rs 1000  for Indian people, 75$ 15$ for international people , 50$ 10$ for Srilankan people Instructions to get course: Indian people can get the course by paying using this UPI id  tamilhacks@ybl  send 1000 Rs to this upi id with subject bug bounty and after payment take a screenshot and send that to email id tamilhackstech@gmail.com - you will get the course within 24 hours. (there will be no tax, when paying using upi id)    The above mentioned method is most preferable. if you don't have a upi id app, install phonepe or google pay   app and register there and pay easily  or  pay here using the alternate method to get this course, this link cost 18% gst for the course . (nearly 30-100Rs for tax and other charges here ) After payment you will receive a payment confirmation mail along with a downlink for the course, you can download the course file using that. As for international peopl