Python values variables: Difference between revisions

From ACL@NCU
Jump to navigation Jump to search
Created page with "==Define a string== <syntaxhighlight lang="python" style="border:3px solid black"> x = "Hello World!" </syntaxhighlight> ==Quotes== <syntaxhighlight lang="python" style="borde..."
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Define a string==
=Values=
<syntaxhighlight lang="python" style="border:3px solid black">
==Integer==
<syntaxhighlight lang="python" style="border:1px black">
10
3 + 6
3*5
</syntaxhighlight>
==Floats==
<syntaxhighlight lang="python" style="border:1px black">
10.0
4.0*8
</syntaxhighlight>
 
 
==Define a variable==
<syntaxhighlight lang="python" style="border:1px black">
x = "Hello World!"
x = "Hello World!"
</syntaxhighlight>
</syntaxhighlight>
==Quotes==
==Quotes==
<syntaxhighlight lang="python" style="border:3px black">
<syntaxhighlight lang="python" style="border:1px black">
y = "I like python!"
y = "I like python!"
z = 'I like python!'
z = 'I like python!'

Latest revision as of 04:47, 14 March 2018

Values

Integer

<syntaxhighlight lang="python" style="border:1px black"> 10 3 + 6 3*5 </syntaxhighlight>

Floats

<syntaxhighlight lang="python" style="border:1px black"> 10.0 4.0*8 </syntaxhighlight>


Define a variable

<syntaxhighlight lang="python" style="border:1px black"> x = "Hello World!" </syntaxhighlight>

Quotes

<syntaxhighlight lang="python" style="border:1px black"> y = "I like python!" z = 'I like python!' y_z = "I 'like' python!"

print y, z, y_z </syntaxhighlight>