# Python Activtiy
#
# Fill in the code for the functions below.
# The starter code for each function includes a 'return'
# which is just a placeholder for your code.

# import regular expression module
import re

# # Part A. starts_with_number
# Define a function starts_with_number(s) that takes a string and returns true
# if it starts with a number and false otherwise.
# (For our purposes, a number is any character that is 0,1,2,3,4,5,6,7,8, or 9.)
# Note: Be sure to use RegEx!
def starts_with_number(s):
  # YOUR CODE HERE
  #if (s) starts with number, return true
  x = re.search("^\d", s)
  if x:
     return True
  else:
     return False
  
# # Part B. starts_with_consonant
# Define a function starts_with_consonant(s) that takes a string and returns true
# if it starts with a consonant and false otherwise.
# (For our purposes, a consonant is any letter other than A, E, I, O, U.)
# Note: Be sure to use RegEx and it works for both upper and lower case and for nonletters!
def starts_with_consonant(s):
  # YOUR CODE HERE
  #if (s) starts with constant, return true
  x = re.search("^[b-zB-Z]", s)
  y = re.search("^[^aeiouAEIOU]", s)
  if x and y:
     return True
  else:
     return False


# Part C. binary_multiple_of_4
# define a method binary_multiple_of_4(s) that takes a string and returns true
# if the string represents a binary number that is a multiple of 4.
# Note: Be sure it returns false if the string is not a valid binary number!
# Hint: Use regular expressions to match for the pattern of a binary number that is a multiple of 4.
def binary_multiple_of_4(s):
  # YOUR CODE HERE
  #if (s) represents binary num/multiple 4, return true
  x = re.search("^[01]", s)
  y = re.search("0$", s)
  if x and y:
     return True
  else:
     return False

8b3c33430a3b4acd071005a7ccb63187da248774
<mask token>


def binary_multiple_of_4(s):
    x = re.search('^[01]', s)
    y = re.search('0$', s)
    if x and y:
        return True
    else:
        return False

<mask token>


def starts_with_consonant(s):
    x = re.search('^[b-zB-Z]', s)
    y = re.search('^[^aeiouAEIOU]', s)
    if x and y:
        return True
    else:
        return False


def binary_multiple_of_4(s):
    x = re.search('^[01]', s)
    y = re.search('0$', s)
    if x and y:
        return True
    else:
        return False

<mask token>


def starts_with_number(s):
    x = re.search('^\\d', s)
    if x:
        return True
    else:
        return False


def starts_with_consonant(s):
    x = re.search('^[b-zB-Z]', s)
    y = re.search('^[^aeiouAEIOU]', s)
    if x and y:
        return True
    else:
        return False


def binary_multiple_of_4(s):
    x = re.search('^[01]', s)
    y = re.search('0$', s)
    if x and y:
        return True
    else:
        return False

import re


def starts_with_number(s):
    x = re.search('^\\d', s)
    if x:
        return True
    else:
        return False


def starts_with_consonant(s):
    x = re.search('^[b-zB-Z]', s)
    y = re.search('^[^aeiouAEIOU]', s)
    if x and y:
        return True
    else:
        return False


def binary_multiple_of_4(s):
    x = re.search('^[01]', s)
    y = re.search('0$', s)
    if x and y:
        return True
    else:
        return False

# Python Activtiy
#
# Fill in the code for the functions below.
# The starter code for each function includes a 'return'
# which is just a placeholder for your code.

# import regular expression module
import re

# # Part A. starts_with_number
# Define a function starts_with_number(s) that takes a string and returns true
# if it starts with a number and false otherwise.
# (For our purposes, a number is any character that is 0,1,2,3,4,5,6,7,8, or 9.)
# Note: Be sure to use RegEx!
def starts_with_number(s):
  # YOUR CODE HERE
  #if (s) starts with number, return true
  x = re.search("^\d", s)
  if x:
     return True
  else:
     return False
  
# # Part B. starts_with_consonant
# Define a function starts_with_consonant(s) that takes a string and returns true
# if it starts with a consonant and false otherwise.
# (For our purposes, a consonant is any letter other than A, E, I, O, U.)
# Note: Be sure to use RegEx and it works for both upper and lower case and for nonletters!
def starts_with_consonant(s):
  # YOUR CODE HERE
  #if (s) starts with constant, return true
  x = re.search("^[b-zB-Z]", s)
  y = re.search("^[^aeiouAEIOU]", s)
  if x and y:
     return True
  else:
     return False


# Part C. binary_multiple_of_4
# define a method binary_multiple_of_4(s) that takes a string and returns true
# if the string represents a binary number that is a multiple of 4.
# Note: Be sure it returns false if the string is not a valid binary number!
# Hint: Use regular expressions to match for the pattern of a binary number that is a multiple of 4.
def binary_multiple_of_4(s):
  # YOUR CODE HERE
  #if (s) represents binary num/multiple 4, return true
  x = re.search("^[01]", s)
  y = re.search("0$", s)
  if x and y:
     return True
  else:
     return False
