ch='a'
print 'equivalent uppercase character is ',ch.upper()
import math
i,j=2.0,3.0
print "%f %f %f %f" %(i,i,i+j,math.sqrt(i+j))
x,y=5000.0,0.0025
print "%f %f %f %f\n\n" %(x,y,x*y,x/y)
print "%e %e %e %e" %(x,y,x*y,x/y)
line="The PITTSBURG STEELERS is one of America's favorite football teams!"
print "%s" %(line)
i=12345
x=345.678
print "%3d %5d %8d\n\n" %(i,i,i)
print "%3f %10f %13f" %(x,x,x)
print "%3e %13e %16e" %(x,x,x)
i=12345
x=345.678
print "%3d %5d %8d\n\n" %(i,i,i)
print "%3g %10g %13g" %(x,x,x)
print "%3g %13g %16g" %(x,x,x)
x=123.456
print "%7f %7.3f %7.1f" %(x,x,x)
print "%12e %12.5e %12.3e" %(x,x,x)
x=123.456
print "%f %.3f %.1f" %(x,x,x)
print "%e %.5e %.3e" %(x,x,x)
line="hexadecimal"
print "%10s %15s %15.5s %.5s" %(line,line,line,line)
a=0x80ec
b=0.3e-12
print "%4x %10.2e\n\n" %(a,b)
print "%4X %10.2E" %(a,b)
i,x,y=123,12.0,-3.3
print ":%6d %7.0f %10.1e: \n" %(i,x,y)
print ":%-6d %-7.0f %-10.1e: \n" %(i,x,y)
print ":%+6d %+7.0f %+10.1e: \n" %(i,x,y)
print ":%-+6d %-+7.0f %-+10.1e: \n" %(i,x,y)
i,j,k=1234,01777,0xa08c
print ":%8u %8o %8x:\n" %(i,j,k)
print ":%-8u %-8o %-8x:\n" %(i,j,k)
print ":%08u %08o %08x:\n" %(i,j,k)
line="lower-case"
print ":%15s %15.5s %.5s:" %(line,line,line)
print ":%-15s %-15.5s %-.5s:" %(line,line,line)
a,b,x1,x2=2.2,-6.2,0.005,-12.88
print "$%4.2f %7.1f%%\n" %(a,b)
print "x1=%7.3f x2=%7.3f" %(x1,x2)
name="Robert Smith"
score1=88
score2=62.5
score3=90
average=(float)(score1+score2+score3)/3
print "Name: %-s" %(name)
print "Score1: %-5.1f" %(score1)
print "Score2: %-5.1f" %(score2)
print "Score3: %-5.1f" %(score3)
print "Average: %-5.1f" %(average)