#take user input
      String = input('Enter the string :')
      #initialize other empty String
      String1 = str()
      #iterate through String
      for i in String:
          #check the case of each iterator
          if i.isupper():
              #change it to opposit case
              i = i.lower()
              #Concat each iterator to String1
              String1 = String1 + i
          else:
              i = i.upper()
              String1 = String1 + i
      #print String1
      print(String + ' after changing ' + String1)
      
      Python language logo

      Program to toggle each character in a string

      0

      0

      avatar
      drzyadav

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.