print("Hello, myself")This code will print "Hello, myself"
Syntax for Variable Assignment:
x = 5 # Assigning an integer value to the variable x
y = "Hello" # Assigning a string value to the variable y"15"
x = int("15") # convert string to integer - 15
y = float("15") # convert string to float number - 15.0+(Addition)-(Subtraction)*(Multiplication)/(Division)//(Floor Division)%(Modulus)**(Exponentiation) Using these operations, we can make the
Assignment operators are used to assign values to variables:
#Operator Examples
= x = 5 x = 5
+= x += 3 x = x + 3
-= x -= 3 x = x - 3
*= x *= 3 x = x * 3
/= x /= 3 x = x / 3
%= x %= 3 x = x % 3
//= x //= 3 x = x // 3
**= x **= 3 x = x ** 3
&= x &= 3 x = x & 3
|= x |= 3 x = x | 3
^= x ^= 3 x = x ^ 3
>>= x >>= 3 x = x >> 3
<<= x <<= 3 x = x << 3
:= print(x := 3) x = 3
print(x)
>>