1. In Shell
>>>print(“Bashar”)
Bashar
2. Scripts
[hello.py]: print(“Hello, world!”) Hello, world!/workspace$ python hello.py Hello, world!
At the end of this course, we’re going to build a Guess the Number game.
There are two ways to execute a Python code:
1. In Shell
>>>print(“Bashar”)
Bashar
2. Scripts
[hello.py]: print(“Hello, world!”) Hello, world!/workspace$ python hello.py Hello, world!
help(print) # Helps you understand what the function print() does
help(str) # Helps you understand what the function str() does
dir(str) # Find the available methods and attributes of dir(str)
help(str.rjust) # Helps you understand what the method rjust() of the function str() does
>>> "Bashar".rjust(35)
' Bashar'