var1 = 2
var2 = 5
puts var1 + var2
it will say 7 it basically var puts the stuff after the = it in to storage with in that tab.We also learned how to get input form YOU all you need is to do is.Lets say i want your name is what we can say is
puts 'hello there, and what\'s your name?'
name = gets.chomp
puts 'your name is ' + name + '? what a lovely name!'
puts 'pleased to meet you, ' + name + '. :)'
the name = gets.chomp you don't need name you can use hello, yes or, save anything you want as long as you have the = gets.chomp. so that is the big things that i learned over this chapter.
puts 'hello there, and what\'s your name?'
name = gets.chomp
puts 'your name is ' + name + '? what a lovely name!'
puts 'pleased to meet you, ' + name + '. :)'
the name = gets.chomp you don't need name you can use hello, yes or, save anything you want as long as you have the = gets.chomp. so that is the big things that i learned over this chapter.
No comments:
Post a Comment