1 min to read
Hello World
In python the print method is used to print anything
In python the print() method is used to print anything.
Say hello world
Note: click the play button to run code.
Task: Change the above code to print your name. Then run the code to see output.
Comments
Comments in python are declared using the Hash (#)
Comments are not printed on screen
Uses of comments
- Documentation
- Leaving out some part of code
- Debugging
- Reminders to do something in some part of code
- Notifications
- Dev Humor
- To tease your colleagues
- To remind of your presence even after you leave the project.
Indentation
Indentation traditionally was seen as a way of making code more more readable. It wasn’t cumpolsary to indent your code well.
Well in python if you forget to indent your code, it’ll fuck up your entire code.
Python defines indentation as a way to define blocks of code. If you miss an indentation for a block of code it will throw error.
Task: Remove the indentation and run the code.
Comments