This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| display alert "Hello, World!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| quiz = { | |
| 1 : { | |
| "pergunta" : "Quantas letras tem a palavra Python?", | |
| "resposta" : "6" | |
| }, | |
| 2 : { | |
| "pergunta" : "Python é uma raça de qual animal?🐍", | |
| "resposta" : "cobra" | |
| }, | |
| 3 : { |