0

I am new to Python and stack overflow. How do I use the count and capitalize functions for my strings? The app I am learning from appears to have this mixed up because it dosen't work in vscode.

It seems like the capitalize function call is ignored. What am I doing wrong? If someone could tell me how to use the count function as well I have the same problem. The app I learn from is called Programminz.

This is Python 3

practice = "CaPITalIzE mE proPerLy"
practice.capitalize()
print(practice)

1 Answers1

1

string_name.capitalize()

string_name: It is the name of string of whose first character we want to capitalize.

Try to use :

string = "CaPITalIzE mE proPerLy"

capitalized_string = string.capitalize()

print('Old String: ', string) print('Capitalized String:', capitalized_string)