YouTip LogoYouTip

Python3 String Upper

body { font-family: Arial, sans-serif; line-height: 1.6; margin: 20px; } h1, h2, h3 { color: #333; } code { background-color: #f4f4f4; padding: 2px 4px; border-radius: 3px; } pre { background-color: #f4f4f4; padding: 10px; border-radius: 5px; overflow-x: auto; } .nav { margin-bottom: 20px; } .nav a { margin-right: 10px; text-decoration: none; color: #0066cc; } .nav a:hover { text-decoration: underline; } .example { margin: 20px 0; } .output { background-color: #e8f4e8; padding: 10px; border-left: 4px solid #4CAF50; } .ad { background-color: #f9f9f9; padding: 15px; border: 1px solid #ddd; margin: 20px 0; border-radius: 5px; }

Python3 upper() Method | Tutorial

Python 3 Tutorial

Python3 Advanced Tutorial


Python3.x Python3 upper() Method

Python3 Strings

Description

The Python upper() method converts all lowercase characters in a string to uppercase.

Syntax

The syntax for the upper() method is:

str.upper()

Parameters

  • NA.

Return Value

Returns the string with all lowercase characters converted to uppercase.

Example

The following example demonstrates the usage of the upper() function:

#!/usr/bin/python3

str = "this is string example from tutorial....wow!!!";
print ("str.upper() : ", str.upper())

The output of the above example is as follows:

str.upper() : THIS IS STRING EXAMPLE FROM TUTORIAL....WOW!!!

ByteArk Coding Plan supports mainstream large models like Doubao, GLM, DeepSeek, Kimi, and MiniMax. Officially supplied, stable and reliable. Β₯9.9/month

iFlytek Star Coding Plan includes free model call quotas for DeepSeek, GLM, Kimi, and MiniMax. One-stop experience and deployment platform. Configuration Guide Β₯3.9/month Subscribe Now

← Python3 String UpperPython3 String Title β†’