Skip to main content

Posts

Build an App from the scratch using Python

 Hey Friends!! The code used in the video is given below: CODE: import json from difflib import get_close_matches jsonfile = json.load(open("data1.json")) word = input("enter the word: ") def check(d):      d = d.lower()     if d in jsonfile:         return jsonfile[d]     elif len(get_close_matches(d,jsonfile.keys())) > 0:         choice = input("Did you mean %s , Enter Y for YES, N for NO "  %get_close_matches(d,jsonfile.keys())[0])         if choice == "Y" or "y":             return jsonfile[get_close_matches(d,jsonfile.keys())[0]]         elif choice == "N" or "n":             return "The word doesn't exist, please enter the correct word"         else:             return "you enterd the wrong choice"     else:         return "The word doesn't exist, please enter the correct word" result = (check(word)) if type(result) == list:     for i in result:         print(i) else:  

100k Give away winners Announcement.

 Hey!!, We have finally reached 100K subscribers. We are very thankful to all the people who supported us. This would not have been possible without you guys. We read all your comments. We assure you ,we will continue to do our best and hopefully correct our mistakes too. Congratulations to all the winners. We have successfully sent the courses to all the ten winners. Once again Big thanks to all the people for participating.

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

37.Python Filter,Map,Reduce

Python Filter:     The python filter() function takes a list as a arguments and filter out the elements in the list based on a function condition and returns the filtered list.Filter takes 2 arguments:function and a sequence and remember to mention the format. syntax: list(filter(function ,sequence)) #you can use tuple,set instead of list Program numbers=[5,7,28,25,40,400,56,78,94,70,100] multiples=list(filter(lambda a:a%5==0,numbers)) print(multiples) Output [5, 25, 40, 400, 70, 100] Python Map:      The python map() can used to update the values in the list.While filters() remove the unwanted element in the list,map() performs some operation to the elements in the list and return the list.Map takes 2 arguments:function and a sequence . syntax: list(map(function ,sequence)) #you can use tuple,set instead of list Program numbers=[5,7,28,25,40,400,56,78,94,70,100] multiples=list(map(lambda a:a+20,numbers)) print(multiples) Output [25, 27, 48, 45, 60, 420, 76, 98, 114, 90, 120] Python Re

36.Python Lambda

Python Lambda:     Usually,we know we define a function with function name,but it is also possible to define a function without a function name.Such functions are known as anonymous functions or Lambda functions.These anonymous functions defined with a  Lambda keyword in python.That is,a lambda function is a small anonymous function.It can take any number of arguments but must have only one expression.For this reason,Lambda functions are used only when we need one expression to calculate the result. For example,consider a simple program to multiply two numbers. Program def multiplication(a,b):     return a*b result=multiplication(26,90) print(result) Output 2340     The above program has only one expression a*b,this can also be made simple by using Lambda/Anonymous function syntax lambda arguments:expression Program k=lambda a,b:a*b result=k(26,90) print(result) Output 2340      Where,k is a variable to store the result of Lambda(anonymous function).a,b are the arguments/parameters.a*b

35.Python Global Variables

Python Global Variables        A function is typically referred as a block of code which allows you to pass data and return data as a result.A function can also have many variables.A variable declared outside the function is known as Global variable and the variable created within the function is known as Local variable.A local variable cannot be used outside the function but a Global variable can be used both inside and outside the function. For example, Program: def myfun():     a=18 #Local variable     print(a) myfun() Output: 18      Here,a variable is created within a function,so it is a local variable.The scope of local variable extends only within the function. If you try to print the local variable outside the function,the program will display error For example, Program: def myfun():     a=18  #Local variable     print(a) myfun() print(a) #Trying to print Local variable Output: 18 NameError: name 'a' is not defined     A global  variable is created outside the function

Python Basic Program-Palindrome

Python Palindrome: Input:a string (Mom) Output:Mom is a palindrome Input:a string (Monk) Output:Monk is not a palindrome Expalanation:    1)The string "Mom" when reversed produces a same word "moM",so it is a palindrome.     2)The string "Monk" when reversed produces a different word"knoM",so it is not a palindrome. Program 1: def palindrome(p):      word=p.lower()      a,*b,c=word      word1=c,*b,a      if list(word)==list(word1):           return "Palindrome"      else:           return "Not a palindrome" word=input("Enter a word:") result=palindrome(word) print(f"{word} is  {result}") Output: Enter a word:Mom Mom is  Palindrome Enter a word:Monk Monk is Not a Palindrome Program 2:using reverse index def palindrome(p):      word=p.lower()      if word==word[::-1]:           return "Palindrome"      else:           return "Not a palindrome" word=input("Enter a word:&quo