Created
December 3, 2013 04:44
-
-
Save marcelcaraciolo/7763973 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#print command | |
print('hello world') | |
print('maça') | |
x = 'hello world' | |
print(x) | |
x = 'hello' | |
y = 'world | |
print(x, y) | |
import math | |
print('O valor de PI é aproximadamente %5.3f' % math.pi) | |
for x in range(1, 11): | |
print(x, x**x, end=' ') | |
print(x*x*x) | |
for x in range(1, 11): | |
print('{0:2d} {1:3d} {2:4d}'.format(x, x*x, x*x*x)) | |
print('We are the {} who say "{}!"'.format('knights', 'Ni')) | |
print('This {food} is {adjective}.'.format(food='spam', adjective='absolutely horrible')) | |
print('The story of {0}, {1}, and {other}.'.format('Bill', 'Manfred',other='Georg')) | |
print('O valor de PI é aproximadamente {0:.3f}.'.format(math.pi)) | |
print ("The %(foo)s is %(bar)i." % {'foo': 'answer', 'bar':42}) | |
http://docs.python.org/3.3/tutorial/inputoutput.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment