Hướng dẫn python check for uppercase - python kiểm tra chữ hoa

Trong bài viết này, chúng tôi sẽ thảo luận về các hàm isupper (), isLower (), up () và lower () trong python. Các phương pháp này là các phương pháp tích hợp được sử dụng để xử lý chuỗi. Trước khi nghiên cứu chúng một cách chi tiết, hãy để một ý tưởng cơ bản về chúng.isupper(), islower(), upper(), and lower() functions in Python. These methods are built-in methods used for handling strings. Before studying them in detail let’s get a basic idea about them.isupper(), islower(), upper(), and lower() functions in Python. These methods are built-in methods used for handling strings. Before studying them in detail let’s get a basic idea about them.

Nội dung chính ShowShow

  • Isupper () trong python là gì
  • Cú pháp của & nbsp; isupper () & nbsp;
  • Islower () trong python là gì
  • Cú pháp: String.isupper () & nbsp;
  • True False0____11 True False7
  • Islower () trong python là gì
  • Cú pháp: String.isupper () & nbsp;
  • Islower () trong python là gì
  • Cú pháp: String.isupper () & nbsp;
  • True False0____11 True False7

Isupper () trong python là gì

Cú pháp của & nbsp; isupper () & nbsp;True if all characters in the string are uppercase, otherwise, returns “False”. 

  1. Islower () trong python là gì
  2. Cú pháp: String.isupper () & nbsp;
  3. True False0____11 True False7

Cú pháp: String.isupper () & nbsp;

Input: string = 'GEEKSFORGEEKS'
Output: True

Input: string = 'GeeksforGeeks'
Output: False

Cú pháp của & nbsp; isupper () & nbsp;

Islower () trong python là gì string.isupper() 

Parameters: 

  • Cú pháp: String.isupper () & nbsp;

True False0____11 True False7 True- If all characters in the string are uppercase. False- If the string contains 1 or more non-uppercase characters.

Hàm này được sử dụng để kiểm tra xem đối số có chứa bất kỳ ký tự chữ hoa nào như:

Python3

Các chữ số và ký hiệu trả về trực tiếp, nhưng nếu chuỗi chỉ chứa các chữ số và số thì sau đó trả về Sai False.

Output:

True
False

Islower () trong python là gì

Cú pháp: String.isupper () & nbsp;True if all characters in the string are lowercase, otherwise, returns “False”. 

  1. Islower () trong python là gì
  2. Cú pháp: String.isupper () & nbsp;
  3. True False0____11 True False7

Cú pháp: String.isupper () & nbsp;

Cú pháp của & nbsp; isupper () & nbsp;

Cú pháp: String.isupper () & nbsp;

True False0____11 True False7string.islower()

Parameters:

  • Hàm này được sử dụng để kiểm tra xem đối số có chứa bất kỳ ký tự chữ hoa nào như:

Returns:

  • Hàm này được sử dụng để kiểm tra xem đối số có chứa bất kỳ ký tự chữ hoa nào như:
  • Các chữ số và ký hiệu trả về trực tiếp, nhưng nếu chuỗi chỉ chứa các chữ số và số thì sau đó trả về Sai False.

True False0____11 True False7

Python3

Islower () trong python là gì

Cú pháp: String.isupper () & nbsp;

Output:

True
False

Islower () trong python là gì

Cú pháp: String.isupper () & nbsp;

  1. Cú pháp: String.isupper () & nbsp;
  2. True False0____11 True False7
True
False
9

Cú pháp: String.isupper () & nbsp;

True False0____11 True False7 string.lower()

Parameters:

  • Cú pháp: String.isupper () & nbsp;

True False0____11 True False7It converts the given string in into lowercase and returns the string.

Examples:

Python3

Các chữ số và ký hiệu trả về trực tiếp, nhưng nếu chuỗi chỉ chứa các chữ số và số thì sau đó trả về Sai False.

Output:

True
False
8

Islower () trong python là gì

Cú pháp: String.isupper () & nbsp;

  1. Cú pháp: String.isupper () & nbsp;
  2. Các chữ số và ký hiệu trả về trực tiếp, nhưng nếu chuỗi chỉ chứa các chữ số và số thì sau đó trả về “sai”
True
False
9

Hàm này được sử dụng để kiểm tra xem đối số có chứa bất kỳ ký tự chữ hoa nào như:

Cú pháp của & nbsp; isupper () & nbsp;string.upper()string.upper()

Parameters:

  • Cú pháp: String.isupper () & nbsp;

isupper () không lấy bất kỳ tham số & nbsp;It converts the given string in into uppercase and returns the string.It converts the given string in into uppercase and returns the string.

Example:

Python3

Islower () trong python là gì

True
False
3
True
False
94

Trong Python, Islower () là một phương thức tích hợp được sử dụng để xử lý chuỗi. Phương thức isLower () trả về true nếu tất cả các ký tự trong chuỗi là chữ thường, nếu không, trả về FALL FALSE. & NBSP;

True
False
3
True
False
34

Output:

True
False
4

Các chữ số và ký hiệu trả về trực tiếp, nhưng nếu chuỗi chỉ chứa các chữ số và số thì sau đó trả về Sai False.

Hàm này được sử dụng để kiểm tra xem đối số có chứa bất kỳ ký tự thường nào như:

True
False
5

True
False
6

  1. Cú pháp của Islower ()
  2. Cú pháp: String.islower ()
  3. isLower () không lấy bất kỳ tham số nào
  4. Đúng- nếu tất cả các ký tự trong chuỗi thấp hơn.

Example:

Python3

True
False
0____11
True
False
82
True
False
83
True
False
1
True
False
85
True
False
86
True
False
1
True
False
88
True
False
89
True
False
1
True
False
88
True
False
92
True
False
1
True
False
88
True
False
95
True
False
96
True
False
97
True
False
98
True
False
99
True
False
40
True
False
41
True
False
1
True
False
1
True
False
44
True
False
45
True
False
46
True
False
86
True
False
48
True
False
1
True
False
50
True
False
46
True
False
83
True
False
48
True
False
1
True
False
55
True
False
99
True
False
57
True
False
58
True
False
1
True
False
1
True
False
44
True
False
45
True
False
46
True
False
89
True
False
48
True
False
1
True
False
50
True
False
46
True
False
83
True
False
48
True
False
1
True
False
02
True
False
99
True
False
57
True
False
05
True
False
1
True
False
1
True
False
44
True
False
45
True
False
46
True
False
92
True
False
48
True
False
1
True
False
50
True
False
46
True
False
83
True
False
48
True
False
1
True
False
19
True
False
3
True
False
21
True
False
22
True
False
23
True
False
3
True
False
21
True
False
26
True
False
27
True
False
3
True
False
21
True
False
30
True
False
31
True
False
3
True
False
21
True
False
34
True
False
35
True
False
3
True
False
21
True
False
38
True
False
23
True
False
3
True
False
41

Output:

True
False
28