This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from turtle import Turtle | |
import random | |
class Food(Turtle): | |
def __init__(self): | |
super().__init__() | |
self.refresh() | |
self.shape("circle") | |
self.penup() | |
self.shapesize(stretch_len=0.5, stretch_wid=0.5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
piano_keys=["a","b","c","d","e","f","g"] | |
piano_tuple=("do","re","mi","fa","so","la","ti") | |
print(piano_tuple[2:5])#example for tuple, ( ) while assigning, [] while manipulating | |
print(piano_keys[2:5:2])#example for list, [] while assigning, () while manipulating | |
print(piano_keys[::2]) | |
print(piano_keys[::-1]) |