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
# -*- coding: utf-8 -*- | |
''' | |
Autor: Luiz Felipe na Lista Python Brasil 31-10-2015 | |
A série de Fibonacci é formada pela seqüência 1,1,2,3,5,8,13,21,34,55,... | |
Faça um programa capaz de gerar a série até o n−ésimo termo. | |
''' | |
#Fn = F(n-1) + F(n-2) | |
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
# Escreva uma classe, chamada Ponto, que representa um ponto no | |
# plano cartesiano. A figura abaixo mostra quais atributos e métodos | |
# da classe. | |
class Ponto | |
attr_reader :x, :y | |
def initialize(x,y) | |
@x = x | |
@y = y |
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 scala.xml.{Node, Elem, Group} | |
/** | |
* A path to a Node in a Node tree. | |
*/ | |
sealed trait NodePath { | |
def depth: Int | |
} | |
object NodePath { |
NewerOlder