DEBUG THE CODE
FIND THE OUTPUT
Coding Vocab
100

i = 0 

for i in range(0, 100):    

      if i % 5 == 1: 

         print(f"{i} is a odd number") 

     else: 

         print(f"{i} is a even number")

i % 2

100

a=0

b=a

print(a)

0

100

What is an algorithm?

A list of steps that you can use to follow a task

200

my_var = 0

if my_var = 0:

     print("test")

if my_var == 0

200

a=input("number: ")

print(a)

(whatever number the user gives)

200

What is a program?

An algorithm (or collection of algorithms) that has been coded into something that can be run by a machine

300
print("he said "the day is fine" and dies.") 
print(''it's fine now. why, because i'm here'') 
print("I am running away from my responsibilities. And it feels good.") 

print("he said /"the day is fine/" and dies.") 
print('it/'s fine now. why, because i/'m here') 

300

index=0

for i in "hello world"

      index=index+1

      if index != 3:   

           print(i)




h

e

l

o


w

o

r

l

d

 

300

What is looping?

The act of doing something over and over again

400

path = "C:\Users\Dell\Desktop\Nutopia\TruthOrDebug\not-the-answers.zip"


with open(path, 'r') as file:

   print(file.read())

1:

"C:\\Users\\Dell\\Desktop\\Nutopia\\TruthOrDebug\\not-the-answers.zip"


2:

r"C:\Users\Dell\Desktop\Nutopia\TruthOrDebug\not-the-answers.zip"

400

factorial = 1

for i in range(10):

    factorial *= i

print(factorial)

0

400

What are conditionals?

Programs or "rewards" that only run when certain parameters are met.

500

my_job


def my_job()

    print("i exist")

def my_job():

    print("i exist")


my_job()

500

for i in range(10):

    if i % 2 == 0:

        continue

    print(i)

1

3

5

7

9


500

Difference between For loop and while loop

In the case of for loop if the condition is not true the first time then the control will never enter a loop. In the case of a while loop if the condition is true then the loop is iterated.