This is a test
On the CSP exam, all counting will start with one
KMSFJKPSF SPFSSDkk sdk; sdfk sdkasdsdfasdfkmdffdd v scd sd xzcxclcc,cvczzc,zc zczczc,zc,zc,,zc,zc,zczc zvzczczc zv vvzzzvz zv v zv ,v ,cv xv,vvb b,b ,. , .cvvcvvvc.cvvcvcvvcvvfcvcv..cvcv.cv.c, .cvvcv.cv vcvv.c ,v ,.v ,.v c. df .. sdf sdd. xc xc c cc xc c
import math
list = [15, 11, 8, 9, 10, 12, 19, 12, 13]
math
name = input("What is your name? ")
print("Hello " + name)
color = input("What is your favorite color? ")
print(name + " likes " + color)
First = ["guitar", "drums", "bass"]
Second = ["flute", "violin"]
Third = []
Third = First
First = Second
Second = Third
print(Second)
x = 3
y = 5
if x > y:
print(x + y)
else:
print(x - y)
p = 10
q = 20
r = 30
s = 40
p = q
q = r
s = q
r = p
print(r)
x = 6
y = 4
z = 10
if x < y:
x = y
else:
z = y
if y >= z:
x = y + z
print(x + y + z)
first = "true"
second = "false"
second = first
first = second
print(first)
print(second)
a = 10
b = 20
c = 30
d = 40
x = 20
b = x + b
a = x + 1
a = x + 1
d = c + d/2
print(a)
print(b)
print(c)
print(d)
word = "on"
word = reversed(word), word
print(word)
weight_lbs = input("How many pounds do you weigh? ")
weight_kilos = int(weight_lbs) / 2.2
print("weight: " + str(weight_kilos))
a = 1000.9
b = 90
b = 1000.89
if a > b:
print("a is greater than b")
elif a < b:
print("b is greater than a")
elif a == b:
print("The two variables are equal, silly.")
first = "john"
last = "smith"
# formatted brackets make the text a lot more easy to see, where is defined place holders. While using first + " [" + last + "] is a coder" works, it gets confusing sometimes.
msg = f"{first} [{last}] is a coder"
print(msg)
name = input("What is your name? ")
print("Hello, " + name)
amongus = 200
print(str(amongus))
import datetime as dt
import requests
BASE_URL = "http://api.openweathermap.org/data/2.5/weather?"
API_KEY = open('api_key', 'r').read()
CITY = "London"
response = requests.get(url).json()
print(response)
import pygame
import random
# Initialize pygame
pygame.init()
# Set the window size
window_size = (600, 600)
# Create the window
screen = pygame.display.set_mode(window_size)
# Set the title of the window
pygame.display.set_caption("Snake")
# Set the size of the snake
snake_size = 20
# Set the snake's starting position
snake_position = [100, 50]
# Set the snake's starting direction
snake_direction = "right"
# Set the size of the food
food_size = 20
# Set the food's starting position
food_position = [300, 300]
# Set the food's color
food_color = (255, 0, 0)
# Set the snake's color
snake_color = (0, 255, 0)
# Set the background color
background_color = (0, 0, 0)
# Set the snake's body
snake_body = [
[100, 50],
[80, 50],
[60, 50]
]
# Set the snake's speed
snake_speed = 20
# Set the font
font = pygame.font.Font(None, 25)
# Set the score
score = 0
# Set the game over flag
game_over = False
# Set the clock
clock = pygame.time.Clock()
# Function to draw the snake
def draw_snake(snake_position):
for position in snake_position:
pygame.draw.rect(screen, snake_color, pygame.Rect(position[0], position[1], snake_size, snake_size))
# Function to move the snake
def move_snake():
global snake_position, snake_direction, snake_body
if snake_direction == "up":
snake_position[1] -= snake_size
elif snake_direction == "down":
snake_position[1] += snake_size
elif snake_direction == "left":
snake_position[0] -= snake_size
elif snake_direction == "right":
snake_position[0] += snake_size
snake_body.insert(0, list(snake_position))
# Function to check for a collision with the food
def check_food_collision():
global snake_position, food_position, snake_body, score
if snake_position == food_position:
score += 1
snake_body.append(list(food_position))
food_position = [random.randrange(1, (window_size[0] // snake_size)) * snake_size,
random.randrange(1, (window_size[1] // snake_size)) * snake_size]
else:
snake_body.pop()
# Function to check for a collision with the wall
def check_wall_collision():
global game_over
if snake_position[0] > window_size[0] or snake_position[0] < 0:
game_over = True
if snake_
a = 6
if a % 2 == 1:
print("odd")
else:
print("even")