Reputation: 13
i am trying with some basics.
space = " "
puts "Some Text: "
count = gets.chomp.to_i
print "#{count}" * space
print "*"
when i trying to run this it shows this error `*': String can't be coerced into Fixnum (TypeError)
Upvotes: 0
Views: 698
Reputation: 30056
I think you wanted something like this
space = " "
puts "Some Text: "
count = gets.chomp.to_i
puts space * count
puts "*"
and use the form string * fixnum
to repeat a string count
times
Upvotes: 1