Skip to content

Instantly share code, notes, and snippets.

@ramarivera
Last active March 12, 2021 15:35
Show Gist options
  • Save ramarivera/61700cff084e4186facc072252d128d7 to your computer and use it in GitHub Desktop.
Save ramarivera/61700cff084e4186facc072252d128d7 to your computer and use it in GitHub Desktop.
Web scraping 01, python 02
####### Operadores sobre Cadenas de texto
nombre = 'Ramiro '
saludo = 'Hola, '
# Concatenacion
resultado = saludo + nombre # 'Hola, Ramiro '
# Caracteres
inicial = nombre[0] # 'R'
####### Operadores Aritmeticos
a = 5
b = 2
# Suma
c = a + b # 7
# Resta
c = a - b # 3
# Producto
c = a * b # 10
# Division decimal
c = a / b # 2.5
# Division entera
c = a // b # 2
# Modulo
c = a % b # 1
# Potencia
c = a ** b # 25
####### Operadores de Comparacion
# Mayor
c = a > b # True
# Menor igual
c = a =< b # False
# Igual
c = a == b # False
####### Operadores Logicos
c = True
d = False
# Y (and logico)
e = c and d # False
# O (or logico)
e = c or d # True
# No (not logico)
e = not (c and d) # True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment