Tutorial Gateway

  • C
  • C#
  • Java
  • Python
  • SQL
  • MySQL
  • Js
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Python Programs
    • Java Programs

Python upper

by suresh

The Python upper function is used to convert the given string into Uppercase letters and return a new string. The syntax of the string upper Function in Python Programming for the uppercase string is

String_Value.upper()

TIP: The String upper Function keep the Non-letters unchanged.

Python upper method Example

The following examples help us to learn the upper Function. Alternatively, say, this Python program converts the specified string to uppercase.

# Python Uppercase Method Example

Str1 = 'Learn PYTHON AT TutOrial Gateway'
Str2 = Str1.upper()
print('First Output of an Upper() method is = ', Str2)

# Observe the Original String
print('Converted String is = ', Str1.upper())
print('Original String is = ', Str1)

# Performing upper() function directly
Str3 = 'PYTHON ProGramming'.upper()
print('Second Output of an Upper() method is = ', Str3)

Str4 = 'python1234TutorIal'.upper()
print('Third Output of an Upper() method is = ', Str4)

Str5 = '12345'.upper()
print('Fourth Output of an Upper() method is = ', Str5)
Python Upper

Within this Python uppercase example, first, we declared the String variable Str1 and assigned a corresponding value using the following statement

Str1 = 'Learn PYTHON AT Tutorial GateWay'

The following statement converts the above string into Uppercase using Python upper function and prints the output

Str2 = Str1.upper()
print('First Output of an Upper() method is = ', Str2)

The uppercase function in Python returns the output in a new string.

print('Converted String is = ', Str1.upper())
print('Original String is = ', Str1)

Use the below Python function code to change the original String.

Str1 = Str1.upper()

The Python Uppercase function only converts the characters to Uppercase and leave others unchanged. Within the below upper String function code, we used the numeric values along with letters, and see the output.

Str4 = 'python1234TutorIal'.upper()
print('Third Output of an Upper() method is = ', Str4)

Str5 = '12345'.upper()
print('Fourth Output of an Upper() method is = ', Str5)

Placed Under: Python

  • Download and Install Python
  • Python Arithmetic Operators
  • Python Assignment Operators
  • Python Bitwise Operators
  • Python Comparison Operators
  • Python Logical Operators
  • Python If Statement
  • Python If Else
  • Python Elif Statement
  • Python Nested If
  • Python For Loop
  • Python While Loop
  • Python Break
  • Python Continue
  • Python Dictionary
  • Python datetime
  • Python String
  • Python Set
  • Python Tuple
  • Python List
  • Python List Comprehensions
  • Python Lambda Function
  • Python Functions
  • Python Types of Functions
  • Python Iterator
  • Python File
  • Python Directory
  • Python Class
  • Python classmethod
  • Python Inheritance
  • Python Method Overriding
  • Python Static Method
  • Connect Python and SQL Server
  • Python SQL Create DB
  • Python SQL Select Top
  • Python SQL Where Clause
  • Python SQL Order By
  • Python SQL Select Statement
  • Python len Function
  • Python max Function
  • Python map Function
  • Python print Function
  • Python sort Function
  • Python range Function
  • Python zip Function
  • Python Math Functions
  • Python String Functions
  • Python List Functions
  • Python NumPy Array
  • NumPy Aggregate Functions
  • NumPy Arithmetic Operations
  • Python Numpy Bitwise operators
  • Numpy Comparison Operators
  • Numpy Exponential Functions
  • Python Numpy logical operators
  • Python numpy String Functions
  • NumPy Trigonometric Functions
  • Python random Array
  • Python numpy concatenate
  • Python numpy Array shape
  • Python pandas DataFrame
  • Pandas DataFrame plot
  • Python Series
  • Python matplotlib Histogram
  • Python matplotlib Scatter Plot
  • Python matplotlib Pie Chart
  • Python matplotlib Bar Chart
  • Python List Length
  • Python sort List Function
  • Python String Concatenation
  • Python String Length
  • Python substring
  • Python Programming Examples
  • C Tutorial
  • C# Tutorial
  • Java Tutorial
  • JavaScript Tutorial
  • Python Tutorial
  • MySQL Tutorial
  • SQL Server Tutorial
  • R Tutorial
  • Power BI Tutorial
  • Tableau Tutorial
  • SSIS Tutorial
  • SSRS Tutorial
  • Informatica Tutorial
  • Talend Tutorial
  • C Programs
  • C++ Programs
  • Java Programs
  • Python Programs
  • MDX Tutorial
  • SSAS Tutorial
  • QlikView Tutorial

Copyright © 2021 | Tutorial Gateway· All Rights Reserved by Suresh

Home | About Us | Contact Us | Privacy Policy