Recent Changes - Search:

Oktatás

* Programozás 1
  + feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

Teaching

* Programming 1 (BI)
  ◇ exercises
  ◇ quick link

teaching assets


Félévek

* 2025/26/2
* 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
* Nim2
* Scala


[ edit | logout ]
[ sandbox | passwd ]

Read from stdin

input()
def main():
    name = input("Name: ").strip()
    print(f"Hello {name}!")
import std/strutils    # strip, split, join
import std/strformat   # &"Hello {name}!"

proc input(prompt: string = ""): string =
  stdout.write(prompt)
  stdin.readLine()

proc main() =
  let name = input("Name: ").strip
  echo &"Hello {name}!"

As you can see, Nim supports optional parameters, just like Python (or D).

Running example:

$ ./main
Name: Laszlo            <E>
Hallo Laszlo!

Where <E> indicates the Enter.

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 2026 April 04, 20:49