Oktatás * Programozás 2 * Szkriptnyelvek * levelezősök Félévek Linkek * kalendárium |
EnPy3 /
20121001aString method Select an arbitrary string method and write a little script that demonstrates it. Some important points:
Here is how to read from the standard input (i.e. keyboard): >>> s = input("Name: ") Name: Laszlo >>> s 'Laszlo' >>> Concrete exercise Let's see a concrete exercise too. Write a program that works the following way: $ ./name.py Name: Fred <E> Hello Fred! That is, the program asks our name interactively. Leave some spaces before and after the name. In the example, "<E>" represents the Enter key. The program must greet us, as can be seen in the example. Python 2 In Python 2, instead of |
Blogjaim, hobbi projektjeim * The Ubuntu Incident [ edit ] |