diff --git a/concat-string.py b/concat-string.py new file mode 100644 index 0000000..caf331f --- /dev/null +++ b/concat-string.py @@ -0,0 +1,4 @@ +primeraEntrada = input('Digite a primeira entrada: ') +segundaEntrada = input('Digite a primeira segunda: ') +concatEntradas = primeraEntrada + ' ' + segundaEntrada +print(concatEntradas) \ No newline at end of file diff --git a/grade-calculator.py b/grade-calculator.py new file mode 100644 index 0000000..279da69 --- /dev/null +++ b/grade-calculator.py @@ -0,0 +1,13 @@ +def grade_calculator (firstNota,secondNota, thirdNota): + return (firstNota + secondNota + thirdNota) / 3 + +firstNota = float(input("Digite a primeira nota: ")) +secondNota = float(input("Digite a segunda nota: ")) +thirdNota = float(input("Digite a terceira nota: ")) + +if(grade_calculator(firstNota, secondNota, thirdNota) > 5): + print("Aprovado!!! Parabéns, aluno.") +else: + print("Reprovado!!! Estude mais.") + + diff --git a/multiplicate-string.py b/multiplicate-string.py new file mode 100644 index 0000000..0d46274 --- /dev/null +++ b/multiplicate-string.py @@ -0,0 +1,3 @@ +output = input('Qual palavra deseja multiplicar ?') +quantidade = int(input('Quantas vezes deseja multiplicar ?')) +print(output * quantidade) \ No newline at end of file diff --git a/palindromo.py b/palindromo.py new file mode 100644 index 0000000..97d83a2 --- /dev/null +++ b/palindromo.py @@ -0,0 +1,13 @@ +def verificar_palindromo(palavra): + palavra_invertida = palavra[::-1] + + if palavra == palavra_invertida: + return True + else: + return False + +palavra = input("Digite uma palavra: ") +if verificar_palindromo(palavra): + print("A palavra é um palíndromo.") +else: + print("A palavra não é um palíndromo.") \ No newline at end of file diff --git a/soma.py b/soma.py new file mode 100644 index 0000000..d4f808f --- /dev/null +++ b/soma.py @@ -0,0 +1,18 @@ +firstInputNumber = int(input('Digite a primeira entrada: ')) +secondInputNumber = int(input('Digite a segunda entrada: ')) +ariathmetic = input('Digite a operação: ex: +, -, *, / ') +def operation(dia:str): + match dia: + case '+': + return firstInputNumber + secondInputNumber + case '-': + return abs(firstInputNumber - secondInputNumber) + case '*': + return firstInputNumber * secondInputNumber + case '/': + return firstInputNumber / secondInputNumber + case _: + return "Valor inválido" + +result = operation(ariathmetic) +print(result) \ No newline at end of file diff --git a/type-number.py b/type-number.py new file mode 100644 index 0000000..a1fc6f6 --- /dev/null +++ b/type-number.py @@ -0,0 +1,3 @@ +typeNumber = int(input('Enter a number: ')) +# ternary operator in python +print ("par" if typeNumber % 2 == 0 else "impar") \ No newline at end of file