Using assignment operator in vs code for python programming

Published: 24 August 2026
on channel: Krish Jaiswal
4
1

syntax of above video (don't copy paste understand the code logic and then try to write it by own)
'''Assignment operators are used to assign values to variables.
In Python, there are several assignment operators that can be used to perform operations
and assign the result to a variable in a single step.'''

num = 10 # Assigning the value 10 to the variable num
print("Initial value of num:", num)
num += 5 # num now assigned 5 more than its original value
print("Value after += 5 to num:", num)

num = 10 # If
num -= 5 # num now assigned 5 less than its original value
print("Value after -= 5 to num:", num)

num = 10 # If
num *= 2 # num now assigned double to its original value
print("Value after *= 2 to num:", num)

num = 10 # If
num /= 2 # num now assigned to half of its original value
print("Value after /= 2 to num:", num)

num = 10 # If
num %= 3 # now num assingned to the remainder of num when divided by 3
print("Value after %= 3 to num:", num)

num = 10 # If
num //= 2 # now num assigned to the floor value of num when divided by 2
print("Value after //= 2 to num:", num)


On this page of the site you can watch the video online Using assignment operator in vs code for python programming with a duration of hours minute second in good quality, which was uploaded by the user Krish Jaiswal 24 August 2026, share the link with friends and acquaintances, this video has already been watched 4 times on youtube and it was liked by 1 viewers. Enjoy your viewing!