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
Printing a variable
Started by icecube45, Nov 10 2012 05:10 PM
5 replies to this topic
#1
Posted 10 November 2012 - 05:10 PM
Let's say I would like to have code print a variable, like for example
#2
Posted 10 November 2012 - 05:11 PM
this belongs in the beta forum
and you have to concatenate the two things using the .. operator:
and you have to concatenate the two things using the .. operator:
print(var.."something")
#3
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
#4
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")
#5
Posted 10 November 2012 - 05:25 PM
luanub, on 10 November 2012 - 05:13 PM, said:
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")
if you plan on doing something like
thing=var,"stuff"it wont work
#6
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.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











