Skip to content

Instantly share code, notes, and snippets.

View cesareds's full-sized avatar

César Eduardo de Souza cesareds

View GitHub Profile
@cesareds
cesareds / resgate_fruit_catalog.py
Created November 29, 2025 20:03
Sample fruit store catalog in Python to exemplify code to young students
soma = 0.0
opcao = "0"
hortifruti = {"maçã": 3.50,
"banana": 1.39,
"alho-poró": 2.99,
"kiwi": 29.85,
"cenoura": 6.00}
while True:
print("sair", hortifruti)
opcao = input("Escolha uma das opcões acima")
@cesareds
cesareds / Interpolate.py
Created November 29, 2025 19:59
Numerical Analysis (ANN) Algorithms
from sympy import *
import math
# Definindo a função f(x)
def f(x):
return math.exp(-x**2) +math.cos(x) + 3
# return x ** 5 - 4 * x ** 2 + 2 * math.sqrt(x + 1) + math.cos(x)
# return 4 + math.sin(x) - (x ** 2) / 30
# Definindo a função para calcular o polinômio interpolador
@cesareds
cesareds / AppleScript_HelloWorld.scpt
Created November 29, 2025 19:55
A helloWorld in each language
display alert "Hello, World!"
@cesareds
cesareds / resgate_change_calculator.py
Created November 29, 2025 19:43
Sample change calculator in Python to exemplify code to young students
x = float(input("Valor a ser trocado"))
cem: int
cinquenta: int
vinte: int
dez: int
cinco: int
dois: int
cem = x // 100
print(cem, "notas de 100")
@cesareds
cesareds / resgate_bmi_calculator.py
Created November 29, 2025 19:41
Sample BMI calculator in Python to exemplify code to young students
altura_metros: float
peso_quilos: float
def imprime_menu():
print("\nOpções:\n"
"0: Sair\n"
"1:Calcular IMC\n")
def calcula_imc(altura, peso):
@cesareds
cesareds / resgate_pedra_papel_tesoura.py
Created November 29, 2025 19:39
Sample rock paper and scissors game in Python to exemplify code to young students
import random
player_1 = input("Insira seu nome\n")
player_2 = "CPU"
while True:
opcao_player_1 = input('insira:\nsair\npedra\npapel\ntesoura\n')
opcao_player_2 = random.choice(["pedra", "papel", "tesoura"])
if opcao_player_1 != "sair" and opcao_player_1 != "pedra" and opcao_player_1 != "papel" and opcao_player_1 != "tesoura":
@cesareds
cesareds / resgate_quiz.py
Created November 29, 2025 19:34
Sample quiz game in Python to exemplify code to young students
quiz = {
1 : {
"pergunta" : "Quantas letras tem a palavra Python?",
"resposta" : "6"
},
2 : {
"pergunta" : "Python é uma raça de qual animal?🐍",
"resposta" : "cobra"
},
3 : {