Google Drive Logo Using Turtle

import turtle as t

t.hideturtle()

t.Screen().bgcolor("Black")

t.pencolor("white")

t.pensize(0)

t.begin_fill()

t.fillcolor('#4688F4')

t.forward(170)

t.left(60)

t.forward(50)

t.left(120)

t.forward(220)

t.left(120)

t.forward(50)

t.end_fill()

t.begin_fill()

t.fillcolor('#1FA463')

t.left(120)

t.forward(200)

t.left(120)

t.forward(50)

t.left(60)

t.forward(150)

t.left(60)

t.forward(50)

t.end_fill()

t.penup()

t.left(120)

t.forward(200)

t.left(120)

t.forward(50)

t.pendown()

t.begin_fill()

t.fillcolor('#FFD048')

t.left(125)

t.forward(160)

t.left(55)

t.forward(53)

t.left(126)

t.forward(163)

t.end_fill()

t.done()


Check whether a string starts and ends with the same character or not (using Regular Expression)

import re

regex = r'^[a-z]$|^([a-z]).*\1$'

def check(string):

if(re.search(regex, string)):

print("Valid")

else:

print("Invalid")

if __name__ == '__main__' :


sample1 = "abba"

sample2 = "a"

sample3 = "abcd"


check(sample1)

check(sample2)

check(sample3)