Welcome, Guest. Please Login
NTCS Homework Board
  Should discrepancies arise between this website and what is told in class, the information given in class takes priority
  HomeHelpSearchLogin Teacher Calendar Activities Calendar  
 
 
Page Index Toggle Pages: 1
Send Topic Print
CS Circles 7A Quiz solution (Read 88 times)
Jan 10th, 2019 at 10:20am

Mr. Vant Erve   Offline
YaBB Teacher
TechCommittee

Posts: 1068
 
Here's the solution to the second question on the quiz.

initials = input()  #get input
firstInitial = ord(initials[0])
secondInitial = ord(initials[1])
if firstInitial >= 97:  #checks for a lowercase letter
    firstInitial = firstInitial - 32 #change to capital
if secondInitial >= 97:  #checks for a lowercase letter
    secondInitial = secondInitial - 32 #change to capital
print( chr(firstInitial) + chr(secondInitial) )
 

<>< <>< <>< <>< <>< <>< <>< <>< <><
                 Mr. D. Vant Erve

         "I sing, for I cannot be silent;
      His love is the theme of my song"
                 -Fanny J. Crosby
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print