Skip to content

Commit e91798b

Browse files
committed
dia 2, un buen comienzo
1 parent b641868 commit e91798b

15 files changed

+110
-56
lines changed

3-print.py 03-print.py

File renamed without changes.

04-numeros.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
a = 26
2+
b= 11.3
3+
c=5
4+
d= 3.5
5+
6+
#suma
7+
print a," +",b,"=", a+b
8+
#resta
9+
print b," +",a,"=",c-a
10+
#multiplicacion
11+
print d,"*",a ,"=" ,d*a
12+
#exponente
13+
print c,"^",2 ,"=",c**2
14+
#division
15+
print c,"/",2 ,"=",c/2
16+
#division ...
17+
print float(c),"/",2 ,"=", float(c)/2
18+
19+
#modulo ...
20+
print 7,"%",3 ,"=", 7%3
File renamed without changes.
File renamed without changes.

05-booleanos.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
bt= True
2+
bF= False
3+
4+
bAnd = True and False
5+
bOr= True or False
6+
bNot = not True
7+
8+
print bAnd,"=True and False"
9+
print bOr,"=True or False"
10+
print bNot,"= not True"

5-cadenas.py 05-cadenas.py

File renamed without changes.

06-Lista.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
l = [2, "tres", True, [1,"dos",3]]
2+
print "lista l =",l
3+
l2 = l[1];
4+
print "el segundo de la lista = ",l2
5+
l3 = l[3][1]
6+
7+
print "lista de lista l[3][1] =",l3
8+
l3 = l[3][1]=2
9+
print "reaccion lista de lista l[3][1] =",l3
10+
l4 = l[0:3]
11+
print "un segmenteo de la lista l[0:3] =",l4
12+
l5 = l[0:3:2]
13+
print "un segmenteo de lista con intervalo l[0:3] =",l5
14+
l6 = l[0::2]
15+
print "un segmenteo de la lista l[0::2] =",l6
16+
l7 = l[1::2]
17+
print "un segmenteo de la lista l[1::2] =",l7
18+
l[0:2]=[4,3]
19+
print "asignacio de una lista l[0:2]=[4,3] =",l
20+
l[0:2]=[4]
21+
print "asignacio de una lista l[0:2]=[4,3] =",l
22+
l9=l[-1]
23+
print "indices invervios l9=l[-1] =",l9
24+
25+

7-Tuplas.py 07-Tuplas.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
t = 1,True,"hola"
22
print t
3-
print type(t)
3+
print "type(t)",type(t)
44
print t[2]
55
#print t[0]="adios"
66

8-Diccionarios.py 08-Diccionarios.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
'Clave2':True,
33
'Clave3':"hola"
44
}
5-
print d['Clave2']
5+
print d['Clave2']
6+
#print d[1]
7+
#print d[0:2]

09-OperecionesRelaciones.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
v=4
2+
c=5
3+
r= v==c
4+
print "5 = 4 ", r
5+
r= v!=c
6+
print "5 != 4 ",r
7+
r= v>=c
8+
print "5>= 4 ",r
9+
r= v<=c
10+
print "5<= 4 ",r
11+
12+
v='Hola'
13+
c='Adios'
14+
r=v==c
15+
print v,"=",c,"=",r
16+
r=v!=c
17+
print v,"!=",c,"=",r
18+
c='Hola'
19+
r=v>=c
20+
print v,"<=",c,"=",r
21+
v=c=["hola",3,5]
22+
r=v==c
23+
print v,"==",c,"=",r
24+
c=["hola",3,4]
25+
r=v!=c
26+
print v,"!=",c,"=",r
27+

10-SentenciaCondicionales.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#encoding: utf-8
2+
edad=100
3+
4+
if edad >= 0 and edad < 18:
5+
print "eres un niño"
6+
elif edad >= 18 and edad < 27:
7+
print "eres un joven"
8+
elif edad>= 27 and 60 >edad:
9+
print "eres adulto"
10+
else:
11+
print "eres de la tercera edad"

10-SentenciaCondicionalesParte2.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
edad=19
2+
m_edad=18
3+
4+
if edad>=m_edad:
5+
print "eres mayor de edad"
6+
if True:
7+
print "esto se ejecuta siempre que sea mayor"
8+
else:
9+
print "no soy mayor de edad"
10+
print "hola como estas "
11+
12+
13+

4-numeros.py

-20
This file was deleted.

5-booleanos.py

-9
This file was deleted.

6-Lista.py

-25
This file was deleted.

0 commit comments

Comments
 (0)