Python values variables

From ACL@NCU
Revision as of 04:47, 14 March 2018 by Aclexp (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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>