Capitalize string using python

Capitalize string using python

Instructor-svgAl-Mamun Sarkar
Mar 23 , 2020

Capitalize string using python. This is a solution to a HackerRank's Python String Problem. Click here to see the problem. 

Code:

#!/bin/python3

import math
import os
import random
import re
import sys

# Complete the solve function below.
def solve(s):
	
	s.captalize()

if __name__ == '__main__':
    fptr = open(os.environ['OUTPUT_PATH'], 'w')

    s = input()

    result = solve(s)

    fptr.write(result + '\n')

    fptr.close()

 

Test Input:

mamun sarkar

Test Output:

Mamun Sarkar
  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram