New course! Every coder should learn Generative AI!
Try a free lesson0
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
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
0
I know that’s why it’s weird
0
Thank you