I would like to know how to check whether a string starts with “hello” in Python.

In Bash I usually do:

if [[ "$string" =~ ^hello ]]; then
 do something here
fi

How do I achieve the same in Python?

5 s
5

Leave a Reply

Your email address will not be published. Required fields are marked *