Skip to content

Instantly share code, notes, and snippets.

@marcelcaraciolo
Created December 3, 2013 04:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcelcaraciolo/7763973 to your computer and use it in GitHub Desktop.
Save marcelcaraciolo/7763973 to your computer and use it in GitHub Desktop.
#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