Documentos de Académico
Documentos de Profesional
Documentos de Cultura
(Apuntes)
OPERADORES
OPERADORES ARITMETICOS
Operación Operador Ejemplo
Suma + 3 + 5.5 = 8.5
Resta - 4-1=3
Multiplicación * 3 * 6 = 18
Potencia ** 3 ** 2 = 9
División (cociente) / 15.0 / 2.0 = 7.5
División (parte entera) // 15.0 // 2.0 = 7
División (resto) % 7%2=1
OPERADORES DE RELACION
Operador Descripción Ejemplo
== ¿Son iguales a y b? r=5==3 # r es False
!= ¿Son distintos a y b? r=5!=3 # r es True
< ¿Es a menor que b? r=5<3 # r es False
> ¿Es a mayor que b? r=5>3 3 r es True
<= ¿Es a menor o igual que b? r=5<=5 # r es True
>= ¿Es a mayor o igual que b? r=5>=3 # r es True
ORDEN DE EJECUCIÓN
El orden normal de las operaciones es de izquierda a derecha, evaluando en orden los
siguientes operadores:
4. Suma y resta.
IDENTACION
PRACTICAS DE LABORATORIO I
SEMESTRE 2020-I
x=input()
y=input ()
a=float(x)+float(y)
print (a)
x=float(input())
y=float(input ())
a=x+y
print (a)
# con mensajes
X=input("INGRESE UN VALOR")
y=input ("INGRESE OTRO VALOR")
a=float(X)+float(y)
print ("LA SUMA ES= ",a)
an=(int(gr)+int(mi)/60+ float(se)/3600)*math.pi/180
seno=math.sin(an)
cose=math.cos(an)
tang=seno/cose
cota=1/tang
seca=1/cose
cosec=1/seno
print ("=================")
print ("SENO= "+str(seno))
print ("coseno= "+str(cose))
print (tang)
print (cota)
print (seca)
print (cosec)
print ("=================")
print ("================================================")
print ("CALCULO DEL AREA DE UN TRIANGULO POR COORDENADAS")
print ("================================================")
import math
x1=float(input("INGRESE LA COORDENADA X DEL PUNTO 1: "))
y1=float(input("INGRESE LA COORDENADA Y DEL PUNTO 1: "))
x2=float(input("INGRESE LA COORDENADA X DEL PUNTO 2: "))
y2=float(input("INGRESE LA COORDENADA Y DEL PUNTO 2: "))
FUNCION IF
#programa que calcula dado un radio utilizando if
import math
import os
r = float(input("radio ? "))
if r<0:
print("ESTA UD BROMEANDO?")
print("FIN DE PROGRAMA...")
if r>0:
a=math.pi*r*r
lc=2*math.pi*r
s=4*math.pi*r*r
v=4/3*math.pi*r*r*r
print ("area= ",a)
print ("long.circunf= ",lc)
print ("superficie= ",s)
print ("volumen= ",v)
lc=2*math.pi*r
s=4*math.pi*r*r
v=4/3*math.pi*r*r*r
print ("area= ",a)
print ("long.circunf= ",lc)
print ("superficie= ",s)
print ("volumen= ",v)
# potencias en python
# elevar el numero 25 a 0.27
x=25
y=0.27
z=x**y
print(z)
cota = 3825.675
while cota <= 3831.450:
print ("Cota Punto= ", str(cota))
cota += 0.027
a=0
for i in range(10):
a+=1
print(a)
print("===================================")
print ("CÁLCULO DE COTAS PENDIENTE POSITIVA")
print("===================================")
a=3825.236
for i in range(20):
a+=0.025
print(a)
print("===================================")
print ("CÁLCULO DE COTAS PENDIENTE NEGATIVA")
print("===================================")
a=3825.236
for i in range(20):
a-=0.027
print(a)
print("===================================")
# CALCULO DE AZIMUTS
print ("BIENVENIDOS A PROGRAMACION EN LENGUAJE PYTHON")
print ("==============================================")
print (" ")
print ("==============================================")
print (" CALCULO DE AZIMUTS EN POLIGONALES ")
print ("==============================================")
print (" ")
import math
print (" INGRESE AZIMUT DE PARTIDA ")
print (" ")
gr = float(input("GRADOS ? "))
mi = float(input("MINUTOS ? "))
se = float(input("SEGUNDOS ? "))
an=(gr+mi/60+ se/3600)
while an>0:
print ("==============================================")
print (" ")
print (" INGRESE ANGULO A LA DERECHA ")
print (" ")
grd = float(input("GRADOS ? "))
mid = float(input("MINUTOS ? "))
sed = float(input("SEGUNDOS ? "))
ad=(grd+mid/60+ sed/3600)
su=an+ad
if su > 360:
su=su-360
if su > 180:
az=su-180
print ("****************************************")
print("AZIMUT CALCULADO = ",int(az),"°",int((az-int(az))*60),"'",(((az-int(az))*60)-
int((az-int(az))*60))*60)
print ("****************************************")
an=az
if su < 180:
az=su+180
print ("****************************************")
print("AZIMUT CALCULADO = ",int(az),"°",int((az-int(az))*60),"'",(((az-int(az))*60)-
int((az-int(az))*60))*60)
print ("****************************************")
an=az
if su > 180:
az=su-180
print ("****************************************")
print("AZIMUT CALCULADO = ",int(az),"°",int((az-int(az))*60),"'",(((az-int(az))*60)-
int((az-int(az))*60))*60)
print ("****************************************")
an=az
if su < 180:
az=su+180
print ("****************************************")
an=az
WEBGRAFIA.
https://entrenamiento-python-basico.readthedocs.io/es/latest/leccion1/
https://baetica.com/python-lenguaje-programacion/
https://www.programoergosum.com/cursos-online/raspberry-pi/244-iniciacion-a-
python-en-raspberry-pi/que-es-python
https://www.edx.org/es/aprende/programacion-python
https://www.genbeta.com/desarrollo/20-cursos-tutoriales-python-para-aprender-a-
programar-lenguaje-amado-desarrolladores
https://es.coursera.org/learn/aprendiendo-programar-python
https://www.paradigmadigital.com/dev/es-python-el-lenguaje-del-futuro/
https://www.youtube.com/watch?v=CjmzDHMHxwU