Welcome to CCP.
Lets get started !
So, we left with variables.
in python, there are numerous types of variables which are:
- string (a sentence or a phrase which contains multiple characters or letters) like: "hello".
- char (a letter or a character) like: "h", "a", "#", "$".
- booleans (a value which can give true or false only) like: isComputerOn = True is a boolean.
- int (a value which is an integer).
- float (a value which is a decimal number with smaller places of decimal).
- double (a value which is a decimal number with larger places of decimal).
conversion of data types:
have a look at this image:
Hope you understood what i did.
Homework !
1. try other data conversions like:
string -> bool
str -> int
int -> string
float -> string
2. try to find out other functions like
type() and str() functions.
Note: these works are given for your hands-on practice to code which is must for all who want to make career in it.
Now, lets move to if-else statements.
all of these statements contain a boolean parameter, it the parameter is true, the block of code under the if statement is executed and if it is false, the block of code in else is executed.
as simple as that !
like this:
also the elif statements:
here ends our tutorial 2 with a homework which is that you have to look and learn the other operators
like ==.
see you later in the next tutorial.
if do the homework, you can send me your work and ask me other things on my email
camelcasesprogramming@gmail.com
Have fun and keep on doing practice, see you later !
Comments
Post a Comment