Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> Python

วิธีเช็คว่า String มี Alphabets หรือ Numbers ใน Python (ซ้ำ)

เนื้อหาเกือบเหมือน ID 1004108109 ใช้ isalnum() และ regex

>> '123abc'.isalnum()
True
>>> '123#$%abc'.isalnum()
False