Conditionals and Loops

Control flow syntax makes use of colons and indentation or else know as white space. if some condition ,then execute some code. elif some other condition, then execute some other code. else if none of the above conditions are true , then execute some other code by default = if x: #it equates it to […]

Read More Conditionals and Loops

Useful operators

range(): for num in range(starting_value,ending_value,increment)ending value is not considered inside the num range generates the number instead of storing it in a list.. Enumerate What it does is it returns an index counter with the data value in a loop .for egword=’abcde’for index,letter in enumerate(word): print(index) print(letter) zip (): just like a zipper it will […]

Read More Useful operators

Python data types

LIST list are ordered sequences ,which can hold variety of object types , it’s also mutable . They are represented by [],and ‘,’ is used to separate objects .It supports indexing and slicing . my_list=[‘kaka’,100,6.42]1.len(my_list) = 32.my_list[0] = ‘kaka’3.my_list[1:] = [100,6.42]4.my_list.append(‘element’) = adds the element at the end of the list 5.my_list.pop() = removes the […]

Read More Python data types