[Solved] What would the ruby equivalent be to this python script?


Python:

print ("{0:5s} {1:7s} {2:9s} {3:6s} {4:25s} {5:s}".format('Rank', 'Points', 'Comments', 'Hours', 'Sub', 'Link'))

Ruby:

puts "%-5s %-7s %-9s %-6s %-25s %-5s" % ['Rank', 'Points', 'Comments', 'Hours', 'Sub', 'Link']

Alternatively:

puts sprintf("%-5s %-7s %-9s %-6s %-25s %-5s", *['Rank', 'Points', 'Comments', 'Hours', 'Sub', 'Link'])

1

solved What would the ruby equivalent be to this python script?