Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.upto 100 do | each |
- first_condition = each % 3 == 0
- second_condition = each % 5 == 0
- if first_condition && second_condition
- puts 'PingPong'
- elsif first_condition
- puts 'Ping'
- elsif second_condition
- puts 'Pong'
- else
- puts each
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement