This file contains 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
package operadoresLogicos | |
/** | |
* Autor: Ruddá Beltrão | |
* Youtube: https://www.youtube.com/channel/UCJ2LUhU6lIvIi5xR8ARplcw | |
* Curso de Kotlin: https://youtu.be/D8g6H4Nx_C0 | |
* Medium: https://ruddabeltrao.medium.com/ | |
* LinkedIn: https://www.linkedin.com/in/ruddabeltrao/ | |
*/ |
This file contains 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
fun main() { // inicio de função | |
// Int, Double e Float | |
var a: Float = 2.toFloat() | |
var b: Float = 3f | |
var c: Int = 4 | |
var d: Double = 5.toDouble() | |
var e: Float = 100.3f | |
var f = 15 |
This file contains 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
var numero_aula: Int = 4 //global | |
val nome_professor: String = "Rudda" | |
const val nome_planeta_terra: String = "Terra" | |
fun main() { // inicio de função | |
/** | |
* Crie variaveis para salvar os seguintes dados de uma pessoa: | |
* 1. nome | |
* 2. sobrenome |
This file contains 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 requests | |
import io | |
from io import BytesIO | |
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter | |
from pdfminer.converter import TextConverter | |
from pdfminer.layout import LAParams | |
from pdfminer.pdfpage import PDFPage | |
def download_pdf(url): | |
response = requests.get(url) |
This file contains 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 xml.etree.ElementTree as ET | |
root = ET.parse('./values/strings.xml').getroot() | |
payload = { 'translations': {}} | |
for type_tag in root.findall('string'): | |
key = type_tag.get('name') | |
value = type_tag.text | |
payload['translations'][key] = str(value).replace("\"", "\\\"") | |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
interface Fly { | |
val wings : Wings | |
fun fly() { | |
println("Im flying") | |
wings.move() | |
} | |
} | |
class Animal(var name: String): Fly { | |
override val wings: Wings = Wings(name) |
This file contains 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
interface Fly { | |
fun fly() { | |
print("Im flying") | |
} | |
} | |
class Animal: Fly { | |
fun SayHi() { | |
print("Hi") | |
} |
This file contains 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
interface Fly { | |
fun fly() | |
} | |
class Animal: Fly { | |
override | |
fun fly() { | |
print("Im flying") | |
} | |
} |
This file contains 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 unittest | |
import calculator | |
class TestCalculator(unittest.TestCase): | |
#test add method | |
def test_add_whenAParamIsNotNumber_thenReturnError(self): | |
a, b= 'A', 2 | |
self.assertRaises(TypeError, calculator.add, a, b) |
NewerOlder