Google Actions And Python

Day well Spent making a google action and learning python basics

Today when I woke up I was just thinking on making a new Google Action. Although I am lagging from my plans on web deveopment but it was fun. I made a GOT quiz out there and it is out for production testing.

10.08am

I am beginning to learn python and now I will be completing python basic tutorials.

There are four classes in python which are namely int,float,complex and str. We can check whether a number belongs to a class or not by simply checking for isinstance(number,class. ) Multiple lines are put in three quotes. Elseif is written as elif is is also used in place of == but the difference is that “is” is used for checking both of the elements are referring to same object or not. If yes then true otherwise false whereas == checks for the value of both the operands. Generally these changes become visible in lists when you compare in lists. len(z) is used for lengths. range(10)means from 0 to 9 range(5,8) means from 5 to 7(both inclusive)

Here in the function name we can just specify any variable name and that will work :P IF nothinf is returned None is returned. if in function definition you are getting a variable you can inilIalize your variables there also. But if the values are passed into the functions then the value which are passed become the default values. It seems that the normal content in python is basically nothing but global platform fro variable. Man! this language is freaking simple. Unlike c or c++ or any language which takes time to learn , here in python we can send parameters in any order by just specifying which variable are you sending. Although the main program must not be knowing anything related to that variable. Strings are considered to have a true value when they are non empty list(map(int,input().split())) This big boy is used for entering values into your list. Python is way to fast but it should do something to change this line for just entering values into your list. Now there are flexibe number of arguments in python function. Just write *something in parameter list and then for a in something: and then apply the functionalities. In the same way you can also send multiple parameters without actually typing them individually. You can have a list suppose list and send *list in parameter list. If you have a list and you have to add it into another list always use += instead of append because what append does is that it adds list as a single element in python that is if a=[1,2,3] and b=[4,5,6] then a+=b will give a=[1,2,3,4,5,6] but a.append(b) will give [1,2,3,[4,5,6]]. List is [] Set is {} Also suppose set_a=[] you cannot use set_a[0]=3 as it is still empty but you can use set_a.append(3) Then after this as an element is present. you can use set_a[0] to modify it or anything. Also as set and dictionaries are saved as {} but when you initialise to an empty set, you have to use set() for empty set and {} for empty dictionary. Append operations are not present in set.

12:00 pm

Time for a break.