36 posts
Posted 10 November 2012 - 05:10 PM
Let's say I would like to have code print a variable, like for example
print("enter a name:")
name = read()
print(name "was your name")
could I just do that? or is there some other way I have to do it
2217 posts
Location
3232235883
Posted 10 November 2012 - 05:11 PM
this belongs in the beta forum
and you have to concatenate the two things using the .. operator:
print(var.."something")
36 posts
Posted 10 November 2012 - 05:12 PM
Ok, thanks. Im using it in a script to lock my computer, sorry for wrong section. fairly new to forums
1111 posts
Location
Portland OR
Posted 10 November 2012 - 05:13 PM
You dont have to concatenate it you can use a comma as well. And this is fine in ask-a-pro. I'm not sure what it has to do with beta??
print(var," Stuff")
2217 posts
Location
3232235883
Posted 10 November 2012 - 05:25 PM
You dont have to concatenate it you can use a comma as well. And this is fine in ask-a-pro. I'm not sure what it has to do with beta??
print(var," Stuff")
that only works with the print command
if you plan on doing something like
thing=var,"stuff"
it wont work
1111 posts
Location
Portland OR
Posted 10 November 2012 - 05:26 PM
Some functions work with the comma, others don't. This topic is about printing, which does work with a comma.