## Learning Python from the Codeschool

There is a funny women on the Web that give lessons of Python and I really enjoy to see her videos and challenges. It is not the traditional professor with a blackboard in behind. Here are some challenges that I resolved as a Python beginner:

#### 1.2 Happy Birthday

```>>>2016 - 1732
284
```

```284/7
40.5714```

#### 1.4 Calculating British Money Spent

```>>> 200*0.65
130.0
>>> (200-2)*0.65
128.70000000000002
>>> ((200-2)*0.65)-100
28.700000000000017```

#### 1.6 Naming Variables

`us_currency`

`70`

#### 1.8 Exchange Rate Calculations

```x_rate = 0.65
total_usd = 200
fee_usd = 2
total_gbp = (total_usd - fee_usd)*x_rate```

#### 1.9 Exchange Rate Calculations 2

```>>> total_usd
42.15384615384618
>>> import math
>>> math.ceil(total_usd)
43```

`G'day`

#### 2.3 String Concatenation

```greeting = "G'day"
new_string = 'mate'
print (greeting+' '+new_string)```

#### 2.4 Cast Number to String

`str(number)`

#### 2.5 Getting Started With Python Strings

```name = "Friends"
description = "a group of friends, lives in NY"
year = 2000
sentence = "My favorite sketch is "+name+" where "+description+"in "+str(year)+"."
print(sentence)```

#### 2.6 String Formatting

```movie1 = "The planet of apes"
movie2 = "La vita e bela"
print ("My Favorite Movies:\n\t",movie1,"\n\t",movie2)```

#### 2.8 Slicing to Create a Substring

`sub_word = word[2:6]`

#### 2.9 Pythonese

```word = 'Python'
first = word
rest = word[1:]
result = rest+"-"+first+"y"
print(result)```

#### 3.2 Choosing the Right Conditional Operator

```answer = 5 < 10

#### 3.3 Comparison Operators

```answer = 5 == 5

#### 3.4 If Else

```rain_speed = 7
if rain_speed < 5:
print ("Just a Scotch mist")
else:
print ("It's a real Cow-quaker out there")```

`Hola`

#### 3.7 Input

`name = input('Enter your name')`

#### 3.8 Rock-Paper-Python

```computer_choice = 'rock'
user_choice = input("Enter rock, paper, or python:\n")
if computer_choice == user_choice:
print('TIE')
else:
print("You lose :( Computer wins :D")```

#### 3.9 Improving Rock-Paper-Python

```computer_choice = 'rock'
user_choice = input("Enter rock, paper, or python:\n")
if computer_choice == user_choice:
print('TIE')
elif user_choice == 'rock' and computer_choice == 'python':
print('WIN')
elif user_choice == 'paper' and computer_choice == 'rock':
print('WIN')
elif user_choice == 'python' and computer_choice == 'paper':
print('WIN')
else:
print('You lose :( Computer wins :D')``` 