Day 4
PS: These are notes, there could be grammar error and spelling errors.
for loops
For loop over a list goes as follows:
range() function
range function creates lists based on parameter passed in function``py
PS: These are notes, there could be grammar error and spelling errors.
For loop over a list goes as follows:
range function creates lists based on parameter passed in function``py
PS: These are notes, there could be grammar error and spelling errors.
Last time we were just starting with If else, the control flow,
Control flow is used when we need to do some decisive task
If statement is simple as it is other language
Things to note:
PS: These are notes, there could be grammar error and spelling errors.
Last time had got until here,
We don’t need specify data type with python something similar to javascript where we use var for every type of variable.(const and let are new ES6 standards, although they are not new but new)
So basically
in above a become integer, b becomes float and c becomes string.
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.
| |
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.