-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmethod_islower.py
More file actions
53 lines (41 loc) · 1.01 KB
/
Copy pathmethod_islower.py
File metadata and controls
53 lines (41 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# -- Method String --
# https://docs.python.org/3/library/stdtypes.html?highlight=islower#str.islower
# Catatan:
# Semua method/metode/fungsi string mengembalikan nilai baru.
# Mereka tidak mengubah string asli.
# fungsi islower() mengembalikan nilai boolean True jika semua karakter dalam huruf kecil,
# jika tidak, maka akan mengembalikan nilai boolean False.
# Angka, simbol, dan spasi di abaikan, hanya karakter alfabet (a-zA-Z).
# Syntax
# string.islower()
# Nilai Parameter
# tidak ada nilai parameter
x = "hello 123 world"
print(x.islower())
# Output:
# True
y = "hello_world@gmil.com"
print(y.islower())
# Output:
# True
print("#!/usr/bin/python".islower())
# Output:
# True
x = "Hello 123 World"
print(x.islower())
# Output:
# False
y = "hello_World@gmail.com"
print(y.islower())
# Output:
# False
print("#!/usr/bin/Python".islower())
# Output:
# False
# periksa apakah karakter huruf kecil semua?
if "python3.8|3.9|3.10".islower():
print("passed")
else:
print("failed")
# Output:
# passed