Python - Operadores de Comparación & Operadores Relacionales Lógicos

import random a=3; b=8; x = random.randint(1, 10) if x == a: print("x == a") else: print("x != a") if x != a: print("x != a") else: print("x == a") if x > a: print("x > a") else: print("x <= a") if x <= a: print("x <= a") else: print("x > a") if x >= a: print("x >= a") else: print("x < a") if x < a: print("x < a") else: print("x >= a") ###################### #Conversión de Negaciones #De conjunción A disyunción #por Ley de Morgan if x > a and x < b: print("x > a and x < b") else: print("x <= a or x >= b") if x >= a and x <= b: print("x >= a and x <= b") else: print("x < a or x > b") if x >= a and x < b: print("x >= a and x < b") else: print("x < a or x >= b") if x > a and x <= b: print("x > a and x <= b") else: print("x <= a or x> b") ####################### #Conversión de Negaciones #De disyunción A conjunción #por Ley de Morgan if x <= a or x>= b: print("x <= a or x>= b") else: print("x > a and x < b") if x < a or x > b: print("x < a or x > b") else: print("x >= a and x <= b") if x < a or x >= b: print("x < a or x >= b") else: print("x >= a and x < b") if x <= a or x > b: print("x <= a or x > b") else: print("x > a and x <= b")

Geogebra Python

import random a=3; b=8; x = random.randint(1, 10) if x == a: print(f"{x:0.0f} == {a:0.0f}") else: print(f"{x:0.0f} != {a:0.0f}") if x != a: print(f"{x:0.0f} != {a:0.0f}") else: print(f"{x:0.0f} == {a:0.0f}") if x > a: print(f"{x:0.0f} > {a:0.0f}") else: print(f"{x:0.0f} <= {a:0.0f}") if x <= a: print(f"{x:0.0f} <= {a:0.0f}") else: print(f"{x:0.0f} > {a:0.0f}") if x >= a: print(f"{x:0.0f} >= {a:0.0f}") else: print(f"{x:0.0f} < {a:0.0f}") if x < a: print(f"{x:0.0f} < {a:0.0f}") else: print(f"{x:0.0f} >= {a:0.0f}") ###################### #Conversión de Negaciones #De conjunción A disyunción #por Ley de Morgan if x > a and x < b: print(f"{x:0.0f} > {a:0.0f} and {x:0.0f} < {b:0.0f}") else: print(f"{x:0.0f} <= {a:0.0f} or {x:0.0f} >= {b:0.0f}") if x >= a and x <= b: print(f"{x:0.0f} >= {a:0.0f} and {x:0.0f} <= {b:0.0f}") else: print(f"{x:0.0f} < {a:0.0f} or {x:0.0f} > {b:0.0f}") if x >= a and x < b: print(f"{x:0.0f} >= {a:0.0f} and {x:0.0f} < {b:0.0f}") else: print(f"{x:0.0f} < {a:0.0f} or {x:0.0f} >= {b:0.0f}") if x > a and x <= b: print(f"{x:0.0f} > {a:0.0f} and {x:0.0f} <= {b:0.0f}") else: print(f"{x:0.0f} <= {a:0.0f} or {x:0.0f} > {b:0.0f}") ####################### #Conversión de Negaciones #De disyunción A conjunción #por Ley de Morgan if x <= a or x>= b: print(f"{x:0.0f} <= {a:0.0f} or {x:0.0f} >= {b:0.0f}") else: print(f"{x:0.0f} > {a:0.0f} and {x:0.0f} < {b:0.0f}") if x < a or x > b: print(f"{x:0.0f} < {a:0.0f} or {x:0.0f} > {b:0.0f}") else: print(f"{x:0.0f} >= {a:0.0f} and {x:0.0f} <= {b:0.0f}") if x < a or x >= b: print(f"{x:0.0f} < {a:0.0f} or {x:0.0f} >= {b:0.0f}") else: print(f"{x:0.0f} >= {a:0.0f} and {x:0.0f} < {b:0.0f}") if x <= a or x > b: print(f"{x:0.0f} <= {a:0.0f} or {x:0.0f} > {b:0.0f}") else: print(f"{x:0.0f} > {a:0.0f} and {x:0.0f} <= {b:0.0f}")