特例:在函数中创建变量? [英] Special Case: Creating a variable in a function?
问题描述
你如何在一个函数中声明和赋值变量
你通过的参数的名称
例如:
当你调用createvariable(myvariable)
它会声明变量myvariable
然后可能会给它分配一些东西。
myvariable ="这是一个真正的变量"
也可以让你以后在函数之外使用它。
How would you declare and assign a variable inside a function THAT HAS
THE NAME OF A PARAMETER YOU PASSED
example:
when you call createvariable("myvariable")
it will declare the variable "myvariable"
and then maybe assign it something.
myvariable = "this is a real variable"
also so you can use it later, outside of the function.
推荐答案
Ju ***** ********@yahoo.com 写道:
你如何声明并在一个函数中分配一个变量
您通过的参数名称
How would you declare and assign a variable inside a function THAT HAS
THE NAME OF A PARAMETER YOU PASSED
请不要喊!
Please don''t shout!
$ b $例如:
当你调用createvariable(" myvariable")时
它将声明变量" ; myvariable"
然后可能会给它分配一些东西。
myvariable ="这是一个真正的变量"
example:
when you call createvariable("myvariable")
it will declare the variable "myvariable"
and then maybe assign it something.
myvariable = "this is a real variable"
你不能。你想解决什么问题?
-
Ian Collins。
You can''t. What problem are you trying to solve?
--
Ian Collins.
你的问题很难理解。你可以尝试在问题上更清楚一点吗?也许是一些代码。
Your question is very hard to understand. Can you try to be a little
clearer in your problem? Maybe some code.
Gaijinco写道:
Gaijinco wrote:
你的问题很难理解。你可以尝试在问题上更清楚一点吗?也许是一些代码。
Your question is very hard to understand. Can you try to be a little
clearer in your problem? Maybe some code.
哪个问题,请保留Usenet帖子的上下文。
-
Ian Collins。
Which question, please retain context on Usenet posts.
--
Ian Collins.
这篇关于特例:在函数中创建变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!