To Check whether a string is a Palindrome or not using python program August 17, 2018 Palindrome wrd=input("Please enter a word : ") wrd=str(wrd) rvs=wrd[::-1] print(rvs) if wrd == rvs: print("This word is a palindrome") else: print("This word is not a palindrome") Output: Please enter a word : hannah hannah This word is a palindrome Share Get link Facebook Twitter Pinterest Email Other Apps Labels Python Programming Share Get link Facebook Twitter Pinterest Email Other Apps Comments
Four Square pattern using Python program August 15, 2018 Four Square Pattern import turtle turObj = turtle.Turtle() turObj.getscreen().bgcolor("#555555") turObj.speed(5000) def star(turtle, size): if size <=5: return else: for i in range(4): turObj.color("#FFFFFF") turtle.forward(size) star(turtle,size/2) turtle.left(270) star(turObj,100) turtle.done() Output: Read more
Star Design using Python program August 15, 2018 Star Design import turtle turObj = turtle.Turtle() turObj.getscreen().bgcolor("#555555") turObj.speed(10) def star(turtle, size): if size <=10: return else: for i in range(30): turObj.color("#FEACFF") turObj.forward(i * 15) turObj.right(144) star(turObj,100) turtle.done() Output: Read more
Comments
Post a Comment