Trying to Print all of the caps that is in a string | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Trying to Print all of the caps that is in a string

https://code.sololearn.com/c8gxIiV4JU8h/?ref=app

5th Mar 2019, 7:59 PM
Michael Harrall
Michael Harrall - avatar
5 Answers
+ 5
print([letter for letter in test if letter.isupper()]) print(''.join(letter for letter in test if letter.isupper()))
5th Mar 2019, 8:10 PM
Diego
Diego - avatar
+ 2
Thank you both I have been beating my self up on this
5th Mar 2019, 8:34 PM
Michael Harrall
Michael Harrall - avatar
0
so my professor has come back and stated he wanted the .upper used i do not get this at all
6th Mar 2019, 2:23 PM
Michael Harrall
Michael Harrall - avatar
0
so with test = "ThiS is CAP" print(test.isupper()) t2 = ([l for l in test if l.upper()]) i get a all characters back
6th Mar 2019, 2:26 PM
Michael Harrall
Michael Harrall - avatar