## Welcome to my basic games!

In class we have learnt to code with python, this are my codes!

##### Nil Cots

This are my python codes using pygame zero:

### Enter name

``````

x= input()
print("What's up", x)
if x == "Jose":
print("That's the name of my dog")

``````

This is a videotutorial showing how to create enter name:

### Eye colour

```

x = input()
print("WoW", x)
if x == "Green":
print("Green like the grass")
elif x == "Blue":
print("Blue like the sea")
elif x == "Brown":
print("Brown like the wood")
else:
print("That's an awesome colour")

```

This is a videotutorial showing how to create eye colour:

### Guess

``````

import random #random is a python libary to ceate random numbers

n = random.randint(0, 200) #n is a integer number from 0 to 200
guesses = 0 #guesses is a variable with initial vale  0

while True: #do the following code all the time
guesses = guesses + 1 #add a guess every time I try to answer
print("Guess the number I am thinking") #show on the screen this question
g = int(input()) #g is a number entered by the user (input()
if g == n: #if the number entered by the user is equal to the random number stop the code
break
elif g < n: #if the number entered by the user is menor than the random number tell user "Try to go higher"
print("Try to go higher")
elif g > n: #if the number entered by the user is higher than the random number tell the user "Go lower or  you won't get it this way"
print("Go lower or you won't get it this way")
print("Correct! You took", guesses, "guesses.")
#if the number entered by the user is correct tell the user "Correct! You took (guesses) guesses"
#tell the user also the number of guesses and the word attemps

``````

This is a tutorial showing how to create guess:

### Random operation

``````

import random

n = random.randint(22, 300)

print("What is", n, "+45-9-5?")
g = int(input())
if g == n + +45-9-5:
print("You are a genius!")
else:

``````

This is a tutorial showing to create random operation

### Continents

``````

score = 0

print("How many continents are on the Earth?")
g = int(input())
if g == 7:
print("Correct")
score = score +1

print("And how many countries are?")
g = int(input())
if g == 194:
print("Correct")
score = score + 1

print("You got:", score)

``````

This is a tutorial showing to create continents:

### Alicia passing

``````

alicia = Actor('alicia')
alicia.topright = 0, 10

WIDTH = 800
HEIGHT = alicia.height + 4

def draw():
screen.clear()
alicia.draw()

def update():
alicia.left += 8
if alicia.left > WIDTH:
alicia.right = 2

``````

This is a tutorial showing how to create Alicia passing:

### Bus

``````

autob = Actor('autob')
autob.topright = 0, 100

WIDTH = 650
HEIGHT = autob.height + 200

def draw():
screen.clear()
autob.draw()

def update():
autob.left += 10
if autob.left > WIDTH:
autob.right = 5

score = 0

def on_mouse_down(pos):
global score
if autob.collidepoint(pos):
score += 1
else:
score -= 1
print("I'll quit u 1 point, now u have:")
print(score)

``````

This is a videotutorial showing how to create Bus: