Close Menu
    Facebook X (Twitter) Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook X (Twitter) Instagram
    TecAdmin
    You are at:Home»Programming»Python»How to Convert String to Uppercase in Python

    How to Convert String to Uppercase in Python

    By RahulAugust 1, 20221 Min Read

    Some times you may require to convert any string to uppercase (all letters). This tutorial will help to convert a string (any case) to the upper case as showing in the below image.

    Python String to Uppercase

    Convert String to Upper Case

    Using Python programming language you can use string .upper() function to convert any string to upper case. Here is the sample Python code to convert string to uppercase.

    1
    2
    3
    4
    >>> s = "Hello Python"
    >>> print(s.upper())
     
    HELLO PYTHON

    Suggested reading

    Some more examples of string conversions in Python.

    • Convert String to Lowercase in Python

    Python
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Installing PIP on macOS

    How to Install PIP on macOS: A Comprehensive Guide

    Using .env Files in Django

    How to Dockerize Python FastAPI Application

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to Install PIP on macOS: A Comprehensive Guide
    • Find Objects Between Two Dates in MongoDB: A Practical Guide
    • How to Check Packages Update History in Ubuntu
    • How to Grep for Contents after a Matching Pattern
    • How to Change Port in Next.Js
    Facebook X (Twitter) Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.