Skip to main content

Posts

Showing posts with the label python gaming

What is turtle.stamp() in python?

turtle.stamp() turtle.stamp() is used to stamp a copy of the turtle shape, it prints the shape at that point and moves forward with the instructions. Here shape of the turtle does not matter. It does the same for every turtle shape.  Example:  Here is the example of stamp() used: import   turtle def   tri ():      for   i   in   range ( 10 ):          turtle . degrees ( 60 )          turtle . forward ( 200 + 10 * i )          turtle . stamp ()          turtle . right ( 200 ) turtle . speed ( 7 ) turtle . color ( "orange" )         tri () turtle . done () For more such posts, stay tuned!

Know the current Covid status of your country using Python!

 We all are aware about COVID-19, i.e. coronavirus infectious disease 2019.  Isn't it fascinating, using python for numerous purpose! So, here is the python program that can help you know the status of COVID-19 of your country. -------------------------------------------------------------------------------------------------------------------------- For this you need to install one package using the pip command. pip install covid -------------------------------------------------------------------------------------------------------------------------- from covid import Covid covid=Covid() cases=covid.get_status_by_country_name("India") #enter the name of the country you want to know the status for x in cases:     print(x,":",cases[x]) -------------------------------------------------------------------------------------------------------------------------- Output of the above program, giving current status is: id : 80 country : India confirmed : 9857029 active : 35...

GAME : SOLVE JUMBLED WORDS! ( Game Programming With Python)

 Hello there, in this article we are going to help the python learning beginners to create a simple game called as "SOLVE THE JUMBLED WORDS".  The piece of code for the same is given : import random   def choose():     words=['rainbow','computer','science','programming','Cool','mathematics','Good','player','condition','student','happy','hope','Joker','Simple','deaf']     pick=random.choice(words)     return pick   def jumble(word):     jumbled="".join(random.sample(word,len(word)))     return jumbled   def thank(p1n,p2n,p1,p2):     print(p1n,"Your score is : ",p1)     print(p2n,"Your score is : ",p2)     print("Thanks for playing")     print("Have a nice day!")       def play():     p1name=input("Enter the name of player 1: ")     p2name=input...