what if we want to divide numbers which are not properly divisible, consider
By default Python considers numbers as integer type. For evaluation of a number in float, we can do like this
Now last expression which I’ll be considering is the exponent. When we want to evaluate 2 power 3 (2 cube), then
Thus, using ** we can evaluate exponent expression.
Now moving onto Variables..
→ It is a pretty much a place holder or a temporary storage. To initialize a variable,
this will assign value 8 to x.
Thus, we can directly use the variables in the command which has the value in it.
We can assign multiple variables also.
What if one needs to enter a value given by the user, i.e. Dynamic initializing. One can do that by using input() function.
>>>x=input(“Enter the number:")
Enter the number:12
Thus, we have completed some of the basics of variables and operators.