Detailed Print – CSKC
Sign In

Search

siteicon
Code Learning#PYTHON#8175 Back

multiple variables

Unlike many other standard programming languages, python supports multiple variables to be given on the left side of assignment and equal number of values that are assigned to these variables.

Source Code

		 

Click to open popup

Run Output

10 20.5 INDIA
30.5 INDIA

Notes

  • Multiple variables can be put on the left side of assignment and different or same types of data types integer, float/decimal or string can be assigned to it as needed.
  • In c++, same code will be
    int x=10; float y=20; String z=”INDIA”;
    cout<<x<<” “<<y<<” “<<z;
    cout<<x+y<<” “<<z;