Python စကားလုံး endswith() ဓာတ်ပြား

အမှုထမ်း

စုံစမ်း စုံစမ်း (.) ဖြစ်သည် လား မှတ်ချက်

txt = "Hello, welcome to my world."
x = txt.endswith(".")
print(x)

အမှုထမ်း အခြေခံ

အသုံးပြုနည်း နှင့် အပြုအရင်

စကားလုံး ဖြစ်သည် မှတ်ချက် ဖြင့် endswith() တွင် True ပြန်လည် ပေးသည်။ အခြားဖြစ်လျှင် False ပြန်လည် ပေးသည်။

လိုင်းဘာသာ

string.endswith(value, start, end)

အခွင့်အရေး ပြင်

အခွင့်အရေး ဖော်ပြ
value တောင်းပန်း
start အတိအကျ အခွင့်အရေး
end အတိအကျ အခွင့်အရေး

ပိုမို အမှုထမ်း

အမှုထမ်း

စုံစမ်း စုံစမ်း "my world." ဖြစ်သည် လား မှတ်ချက်

txt = "Hello, welcome to my world."
x = txt.endswith("my world.")
print(x)

အမှုထမ်း အခြေခံ

အမှုထမ်း

စုံစမ်း စုံစမ်း 5 နှင့် 11 အထိ "my world." ဖြစ်သည် လား မှတ်ချက်

txt = "Hello, welcome to my world."
x = txt.endswith("my world.", 5, 11)
print(x)

အမှုထမ်း အခြေခံ