Course Introduction

Install Python

Learn the Basics Through Visual Exercises

The Power of Functions

Project: Circle of Squares

Data Types (Let's Learn Some Adult Programming Stuff)

Conditionals and Control Flow

Exercises (a.k.a Drill and Kill)

Video and Written Solutions for Exercises

Project 2: Rock Paper Scissors

Interactive Exercises

- Functions start with
**def** - Don't forget your colons
- Always
**return**in functions rather than**print**!

Example Problem.

Write a function **add_two **that takes in two numbers as input and returns their sum.

## 16 comments

Easy peasy.

A is just an input variable

Its saying if 'a' is divided by 2 and whatever is left over equals zero then the number is even

def is_even(a):

return a % 2 == 0

if number1 % number2 == 0:

return True

else:

return False

is_number_divisible(10, 3)

print(is_number_divisible(9, 3))

print(is_number_divisible(5467, 87))

if number % 2 == 0:

return True

else:

return False

>>> print(test_is_even(10))

return number % 2==0

print(is_even(10))

if number % 2 == 0:

return True

else:

return False

# DO NOT remove lines below here,

# this is designed to test your code.

def test_is_even():

assert is_even(2) == True

assert is_even(3) == False

assert is_even(8) == True

assert is_even(100) == True

assert is_even(101) == False

print("YOUR CODE IS CORRECT!")

Everything is correct but it's not printing out YOUR CODE IS CORRECT

return number % 2 == 0

print(is_even(19))

return number%2==0

True

just one line

return number % 2 = false

return number % 1 = true

am I the only one that got confused and put this

File "python", line 2, in is_even

RecursionError: maximum recursion depth exceeded in comparison

I get that error when I try to run the first code with is_even(anyevennumber).... the first line of the error are repeated a lot and then it comes the last part. What does that mean???

https://repl.it/FBF7/2

What does it mean??