FUNDAMENTALS OF COMPUTER

COMPUTER PROGRAMMING FUNDAMENTALS

WHAT IS PROGRAMMING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What symbol is used to assign values in Python?
A
=
B
==
C
D
None of the above
Explanation: 

Detailed explanation-1: -In Python the = symbol assigns the value on the right to the name on the left. The variable is created when a value is assigned to it.

Detailed explanation-2: -The = symbol is known as the assignment operator. It is also possible to declare a variable and assign it a value in the same line, so instead of int i and then i = 9 you can write int i = 9 all in one go.

Detailed explanation-3: -There is new syntax := that assigns values to variables as part of a larger expression.

Detailed explanation-4: -In Python, variables need not be declared or defined in advance, as is the case in many other programming languages. To create a variable, you just assign it a value and then start using it. Assignment is done with a single equals sign ( = ):

Detailed explanation-5: -The plus-equals operator += provides a convenient way to add a value to an existing variable and assign the new value back to the same variable. In the case where the variable and the value are strings, this operator performs string concatenation instead of addition.

There is 1 question to complete.