Skip to content

Commit c00b2cc

Browse files
committed
ejercicio 1
ejercicio 1
1 parent cec293c commit c00b2cc

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

Ejercicio 1/ejercicio1.py

+8
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1+
# -*- coding: utf-8 -*-
2+
13
print "Hello, world!!"
4+
print "hello Again"
5+
print "I like typing this"
6+
print "This is fun"
7+
print 'Yay! Printing.'
8+
print "I'd much rather you 'not'.ñ"
9+
print 'I "said" do not touch this'

Ejercicio 2/ejercicio2.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# A comment, this is so you can read your program later
4+
# Anything after the # is ignored by python
5+
6+
print "I could have code like this"
7+
8+
# You can also use a comment to disable or commnet out a piece of code:
9+
# print "this won't run."
10+
11+
print "This will run"

Ejercicio 3/ejercicio3.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# -*- coding: utf-8 -*-
2+
3+
print "I will now count my chickens:"
4+
5+
print "Hens", 25 + 30 / 4
6+
print "Roosters", 100.0 - 25.0 * 3.0 % 4.0
7+
8+
print "Now I will count the eggs:"
9+
10+
print 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6
11+
12+
print "Is it true that 3 + 2 < 5 - 7?"
13+
14+
print 3 + 2 < 5 - 7
15+
16+
print "What is 3 + 2?", 3 + 2
17+
print "What is 5 - 7?", 5 - 7
18+
19+
print "Oh, that's why it's False"
20+
21+
print "How about some more"
22+
23+
print "Is it greater?", 5 > -2
24+
print "Is it greater or equal?", 5 >= -2
25+
print "Is it less or equal?", 5 <= -2

Ejercicio 4/ejercicio4.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# -*- coding: utf-8 -*-
2+
3+
cars = 100
4+
space_in_a_car = 4.0
5+
drivers = 30
6+
passengers = 90
7+
cars_not_driven = cars - drivers
8+
cars_driven = drivers
9+
carpool_capacity = cars_driven * space_in_a_car
10+
average_passengers_per_car = passengers / cars_driven
11+
12+
print "There are", cars, "cars available."
13+
print "There are only", drivers, "drivers available."
14+
print "There will be", cars_not_driven, "empty cars today."
15+
print "We can transport", carpool_capacity, "people today."
16+
print "We have", passengers, "to carpool today."
17+
print "We need to put about", average_passengers_per_car, "in each car."

0 commit comments

Comments
 (0)