Factorial in ruby | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Factorial in ruby

Def factorial(x) Puts 1.upto(x).inject('*') end factorial(5) Can anyone explain how this is executing ??

4th Mar 2022, 5:24 PM
SHIVAM ROHILLA
1 Antwort
0
Actually I want to understand Puts 1.upto(x).inject('*)
5th Mar 2022, 3:25 AM
SHIVAM ROHILLA