Recent Changes - Search:

Oktatás

* Programozás 2
  + feladatsor
  + C feladatsor
  + Python feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

* levelezősök
  + Adator. prog.
  + feladatsor
  + quick link

teaching assets


Félévek

* 2024/25/1
* archívum


Linkek

* kalendárium
   - munkaszüneti napok '20
* tételsorok
* jegyzetek
* szakdolgozat / PhD
* ösztöndíjak
* certificates
* C lang.
* C++
* C#
* Clojure
* D lang.
* Java
* Nim
* Scala


[ edit | logout ]
[ sandbox | passwd ]

20120815e

Palindrome

Write a function that decides about a string if it's a palindrome. A string is said to be palindrome if it reads the same backwards as forwards, e.g. madam.

Solve the exercise in different ways:

(1) Trivial method (in Python it's very easy to reverse a sequence).

(2) Iterative method. You are not allowed to make a copy of the string.

Tip: you can use a while loop. It works similarly to C:

i = 0
while i < 5:
    print(i)
    i += 1

(3) Recursive method. Just to practice recursion too.

Cloud City

  

Blogjaim, hobbi projektjeim

* The Ubuntu Incident
* Python Adventures
* @GitHub
* heroku
* extra
* haladó Python
* YouTube listák


Debrecen | la France


[ edit ]

Edit - History - Print *** Report - Recent Changes - Search
Page last modified on 2017 August 04, 09:37