In Twitter I came across a girl’s tweets – a very young girl; her tweets made me feel like write a few lines of song – a very quick song of few lines …
Yo, lonely girl, you touched me hard.
I tried to fly like a bird. But I fail,
a stupid nerd…. Yo, girl,
…touched me hard.
In Python string is an immutable object and can be written within double quotes or single quote.
Continue reading “Strings in Python”
In Python there are two kind of numbers. One is integer and the other is float. We have in built methods in Python that can change an integer to float and change float to integer.
Continue reading “Numbers in Python”
In Python everything is an object.
To start with, you need to remember few things:
1) Variables, functions and even code are object.
2) Every object has an ID, type and value.
Continue reading “Variable, Object and Value”
A man went to Goutam Buddha and said, “I want happiness”.
Buddha said, “First remove ‘I’, that is Ego. Then Remove ‘want’, that is ‘Desire’ and see what you have – happiness.
In Python everything is an object. Let us try to understand how it works and what it actually means.
a = 4
if __name__ == '__main__':
Continue reading “Assigning Values in Python”
There are two forms of conditionals in python conditional executions and conditional expressions or values. Let us see some examples:
Continue reading “Conditional executions and conditional expressions or values in Python”
How we can create different objects in python.
def __init__(self, kind = 'fired'):
self.kind = kind
fried = Egg()
scrambled = Egg('scrambled')
if __name__ == "__main__":
Why we need a main script? We will see how it comes to our help in the later part when we write modules but first of all we can call any function inside it and never care where we declare that function. Let us see an example first
Continue reading “Why we need a main script in Python”