Concatenation :


symbol is used for the concatenation or join 2 strings and it’s also used as the mathematical operations.

pic1

+ symbol is concatenate only strings. its not concatenate numbers and strings.it will give you the error.

Picture2

But if you are pass the number as string format then it can join.

Picture3

Square root:

When you want to find the square of the number that time we can use “**” (2 stars) symbol.

Picture4

Comments :

​​Comments are used for just display the information. You can say information about the code like which code is what for. Or also used for the give the heading of the particular project.

Comments are not including in the execution part. Its just for the show the info.

There are 2 types of comments in python

  1. Single line Comments
  2. Multi Line Comments

 

  • Single Line Comments:
    • It is used when you want to give comment only on single line.
    • You can give single line comment using the “#” (Hash) symbol.

 

Picture5


  • Multi Line Comments:
    • Multi Line comment is used for when you want to give comments on multiple lines at a time.
    • You can give multi line comments using Triple single Quotation:

('''...............................

    .................................

       ..................................''')

Picture5

Creating Variables:


Variable is the temporary storage for storing the values.

You can create variables with the use of A-Z characters, word and using the underscore then give any alphabets or word like (_demo).

We cannot create variable using the numbers.

Each and every variable having the data types based on given value. for example, if your variable’s value is 10 then its datatype is integers, if value is Alphabets word then variables type is String. Same for float values and Boolean.

In Boolean if you use any logical operation then its converts into Boolean types.

Picture5