Day 4 PS: These are notes, there could be grammar error and spelling errors. for loops For loop over a list goes as follows: 1 2 3 4 5 6 7 8 >>> a = ['Fedora', 'is', 'powerful'] >>> for x in a: ... print(x) ... # these ... are automatically created by python interpreter Fedora is powerful range() function range function creates lists based on parameter passed in function``py
Day 3 PS: These are notes, there could be grammar error and spelling errors. Last time we were just starting with If else, the control flow, if-else , the control flow Control flow is used when we need to do some decisive task if, if else, if elif else statement If statement is simple as it is other language 1 2 if expression: do this 1 2 3 4 if expression: do this else: do this 1 2 3 4 5 6 if expression: do this elif expression: do this else: do this Things to note:
Day 1 Installing python one can install python using package manager depending upon the operating system you are using. As I have a windows machine and ubuntu using linux on windows subsystem. I can install python from https://python.org. And Ubuntu I can use below command to install python. 1 sudo apt-get install python3 Running python To run python you would call python3 which open Python interpreter. On that you can type print(“Hello World”) to run your first python code which would print Hello World in next line.