0

Hi guys what's the difference between string and print?

Python3

17th Apr 2019, 12:24 AM
BAGUIDY Bachmar
BAGUIDY Bachmar - avatar
7 Réponses
+ 2
Print is a function to print something on the screen whereas string is a data type. x='hi' print(x) #output=hi Here x is a variable which has string data type and we use print function to print x variable on the screen.
17th Apr 2019, 3:56 AM
Maninder $ingh
Maninder $ingh - avatar
+ 1
If you mean the functions: Str(x) turns the valuable x into a string datatype print(x) prints out the variable x so you can see the value when you run your code
17th Apr 2019, 12:56 AM
Nico
Nico - avatar
0
Send me a piece of code if you didn't understand my explanation and i will show you in the code.
17th Apr 2019, 12:57 AM
Nico
Nico - avatar
0
We use print(hello world) and string(example..) i don't really see the difference
17th Apr 2019, 2:26 AM
BAGUIDY Bachmar
BAGUIDY Bachmar - avatar
0
In Python?
17th Apr 2019, 2:28 AM
Nico
Nico - avatar
0
Yes
17th Apr 2019, 2:32 AM
BAGUIDY Bachmar
BAGUIDY Bachmar - avatar
0
Ok I understand now
17th Apr 2019, 4:51 AM
BAGUIDY Bachmar
BAGUIDY Bachmar - avatar