About 50 results
Open links in new tab
  1. python - How to change a string into uppercase? - Stack Overflow

    How can I convert a string into uppercase in Python? When I tried to research the problem, I found something about string.ascii_uppercase, but it couldn't solve the problem:

  2. Changing string to uppercase in python - Stack Overflow

    Mar 5, 2019 · In Python str.upper() returns a copy of the string with upper case values, and does not mutate the original string. In fact, strings in Python are immutable anyways.

  3. How can I capitalize the first letter of each word in a string?

    import string string.capwords("they're bill's friends from the UK") >>>"They're Bill's Friends From The Uk" From the Python documentation on capwords: Split the argument into words using str.split (), …

  4. Converting specific letters to uppercase or lowercase in python

    So to return a copy of a string converted to lowercase or uppercase one obviously uses the lower() or upper(). But how does one go about making a copy of a string with specific letters converted to upper …

  5. python - Capitalize a string - Stack Overflow

    Does anyone know of a really simple way of capitalizing just the first letter of a string, regardless of the capitalization of the rest of the string? For example: asimpletest -> Asimpletest

  6. python how to uppercase some characters in string

    You can use the str.translate() method to have Python replace characters by other characters in one step. Use the string.maketrans() function to map lowercase characters to their uppercase targets:

  7. python - Random string generation with upper case letters and digits ...

    Generating a string of 6 characters from the 26 uppercase letters plus 10 digits, randomly choosing each character independently, any particular string occurs with frequency 1/ (36^6).

  8. python - Check if all characters of a string are uppercase - Stack Overflow

    Jul 10, 2020 · 36 Say I have a string that can contain different characters: e.g. word = "UPPER£CASe" How would I test the string to see if all the characters are uppercase and no other punctuation, …

  9. python - Can you cast a string to upper case while formating - Stack ...

    Mar 6, 2019 · 6 Motivation Suppose you have a string that is used twice in one string. However, in one case it is upper, and the other it is lower. If a dictionary is used, it would seem the solution would be …

  10. python - Convert a list with strings all to lowercase or uppercase ...

    I have a Python list variable that contains strings. Is there a function that can convert all the strings in one pass to lowercase and vice versa, uppercase?