变量赋值是指将一个值赋给一个变量。以下是一些不同编程语言中变量赋值的代码示例:
在Python中:
x = 5
y = "Hello"
在JavaScript中:
let x = 5;
let y = "Hello";
在Java中:
int x = 5;
String y = "Hello";
在C++中:
int x = 5;
std::string y = "Hello";
在C#中:
int x = 5;
string y = "Hello";
在PHP中:
$x = 5;
$y = "Hello";
在Ruby中:
x = 5
y = "Hello"
在Swift中:
var x = 5
var y = "Hello"
这些示例中,变量x被赋值为整数5,变量y被赋值为字符串"Hello"。