More Python programming
More python programming.
Objective: To know more of Python.
If you haven’t read (past tense) the previous
information then, read the first post https://bennyasare.blogspot.com/2023/10/python-and-crafting-pac.html before you
read this one.
int= it
stands for integer. It works like the print command and a variable but instead,
it uses numbers instead of text.
Example:
int=1*4
Here are the
arithmetic operators in I.C.T:
*=multiplication
/=Division
+=Addition
-=Subtraction
**=Exponentials
str=it stands for string.
It works like the print command and a variable,
but you can type text or any characters but in the speech marks.
Example: str=” Hello my friend’’
Or: str= (” Hello my friend”)
Note you can use single or double quote.
bool=it stands for Boolean.
It works like the print command and a variable,
but it accepts True or False as an input.
bool=True
bool=False
You can use the bool command as a string
command.
bool=” hello, and good morning”
bool= (” hello, and good morning”)
or is a logical operator used in commands.
bool=True or False
str=” Hello” or ‘’Hallo’’
And is a logical operator it can be used in
commands.
bool=True and False
str=’’No’’ and “Yes’’
Not is a logical operator it can be used in
commands.
bool=not True
bool=not False
How to download Python
1. Go to
python.org/downloads/.
2. Click on
‘download for windows’ in the downloads tab.
3. Tick ‘add
Python to PATH’ and use admin privileges when installing py.exe.
4. Click on
install now.
Thanks! Leave a comment under the blog post!
👍https://bennyasare.blogspot.com/2023/12/more-python-programming.html
Fun Fact: Scratch is a visual block-based IDE.
Its nice
ReplyDelete