How | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How

text=gets.chomp T= text.scan(/[A-Z]/).length t= text.scan(/[a-z]/).length if t>T print text.downcase! elsif T>t print text.upcase! elsif t==T print text.downcase! end How do I let it print the text if t=0, it’s not returning anything if t=0

20th Dec 2021, 2:11 PM
John Watson
3 Answers
0
John Watson Very wierd thing is happening here. When T is 4 and t is 1 then it is working but when t is 0 it is not working even 4 > 0 returns true
20th Dec 2021, 4:10 PM
A͢J
A͢J - avatar
0
I know that’s why it’s weird
20th Dec 2021, 4:22 PM
John Watson
0
Thank you
28th Dec 2021, 9:52 PM
John Watson