import requests

def can_access(url):
    try:
        current_page = (requests.get(url).text, 'lxml')
        answer = "SL"
    except requests.exceptions.ConnectionError:
        answer = "PL"
    return answer
import requests

def can_access(url):
    try:
        current_page = (requests.get(url).text, 'lxml')
        answer = "SL"
    except requests.exceptions.ConnectionError:
        print("ERROR: Page is inaccessible, return U and move to next case.")
        answer = "U"
    return answer
Change handling for inaccessible pages
Change handling for inaccessible pages

  import requests
  
  def can_access(url):
      try:
          current_page = (requests.get(url).text, 'lxml')
          answer = "SL"
      except requests.exceptions.ConnectionError:
+         print("ERROR: Page is inaccessible, return U and move to next case.")
-         answer = "PL"
+         answer = "U"
      return answer
Change handling for inaccessible pages
## Code Before:
import requests

def can_access(url):
    try:
        current_page = (requests.get(url).text, 'lxml')
        answer = "SL"
    except requests.exceptions.ConnectionError:
        answer = "PL"
    return answer
## Instruction:
Change handling for inaccessible pages
## Code After:
import requests

def can_access(url):
    try:
        current_page = (requests.get(url).text, 'lxml')
        answer = "SL"
    except requests.exceptions.ConnectionError:
        print("ERROR: Page is inaccessible, return U and move to next case.")
        answer = "U"
    return answer