Turtle 3D cubes

import turtle

screen=turtle.Screen()  

screen.setup(800,800)   

trtl = turtle.Turtle()

screen.title("3-D CUBES")

trtl.penup()

trtl.setposition(0,0)

trtl.setheading(90)

trtl.color('red')

def hexagon():

    for i in range(6):

        trtl.fd(50)

        trtl.rt(60)

i = 1

while i < 7:

    trtl.pendown()

    hexagon()

    trtl.right(60)

    i = i + 1 

Check if an URL is valid or not using Regular Expression

import re

def isValidURL(str):

regex = ("((http|https)://)(www.)?" +

"[a-zA-Z0-9@:%._\\+~#?&//=]" +

"{2,256}\\.[a-z]" +

"{2,6}\\b([-a-zA-Z0-9@:%" +

"._\\+~#?&//=]*)")

p = re.compile(regex)

if (str == None):

return False

if(re.search(p, str)):

return True

else:

return False

url = "https://www.pythonforengineers.in"

if(isValidURL(url) == True):

print("Yes")

else:

print("No")