Well ! Let's try our first code!
a = 21 b = 10 c = 0 c = a + b print "Line 1 - Value of c is ", c c = a - b print "Line 2 - Value of c is ", c c = a * b print "Line 3 - Value of c is ", c c = a / b print "Line 4 - Value of c is ", c
"If you have a tail
then you are a Lion!"
for i in range(10): print('Hello')
The most basic data structure in Python is the sequence. Each element of a sequence is assigned a number - its position or index. The first index is zero, the second index is one, and so forth.
Python has six built-in types of sequences, but the most common ones are lists and tuples, which we would now.
There are certain things you can do with all sequence types. These operations include indexing, slicing, adding, multiplying, and checking for membership. In addition, Python has built-in functions for finding the length of a sequence and for finding its largest and smallest elements.
| file.closed | Returns true if file is closed, false otherwise. |
| file.mode | Returns access mode with which file was opened. |
| file.name | Returns name of the file. |
| file.softspace | Returns false if space explicitly required with print, true otherwise. |