Posts

Es werden Posts vom Oktober, 2018 angezeigt.

Lösung der Aufgaben in Python tutorials

Wir werden in zukunft die Lösungen der Aufgaben, welches sich in den Tutorials befinden werden, auf unserer GitHub Seite hochladen. Ihr könnt es natürlich hier besuchen und das jeweilige Projekt aufrufen. Viel Spaß beim Programmieren lernen.

Solving the tasks in Python tutorials

We will upload in the future the solutions of the tasks, which will be in the tutorials, on our GitHub page. Of course you can visit it here and call up the respective project. Have fun learning programming.

Random numbers and branches in Python

Bild
In our last part, we were able to imagine the variables, data types and operators by means of a mathematics game. Now we will treat the random numbers as well as branches in Python. Random numbers In Python, as with Java, a random generator is available to the programmer. The functions of the random number generator are contained in an additional module, which must first be imported. The mathematics game, which we have programmed in the previous section, we edit as follows. The program does not deliver predefined numbers as a task solution anymore but random tasks. Of course, we initialize the variables within the numbers one through ten, with the tens. Additional modules can be integrated into the program using the import statement. We can then call the functions of these modules in the notation "module name.function name". Calling the seed () function of the random module causes the random number generator to initialize with the current system time. Otherwise, it co

Zufallszahlen und Verzweigungen in Python

Bild
Wir haben in Unserem letzen Teil die Variablen, Datentypen und Operatoren anhand eines Mathematik Spiels uns vorstellen können. Jetzt werden wir die Zufallszahlen sowie Verzweigungen in Python behandeln. Zufallszahlen In Python steht, wie bei Java, ein Zufallsgenerator für den Programmierer zur Verfügung. Die Funktionen des Zufallsgenerators befinden sich in einem zusätzlichen Modul, das zunächst importiert werden muss. Das Mathematik Spiel, welches wir im Vorherigen Abschnitt programmiert haben bearbeiten wir wie folgt. Das Programm liefert jetzt keine Vorgegebenen Zahlen als Aufgabenlösung mehr sondern Zufällige Aufgabenstellungen. Wir initialisieren natürlich die Variablen innerhalb der Zahlen Eins bis Zehn wobei die Zehn. Zusätzliche Module können Sie mithilfe der Anweisung import in das Programm einbinden.  Die Funktionen dieser Module können wir anschließend in der Schreibweise „Modulname.Funktionname“ aufrufen. Der Aufruf der Funktion „seed()“ des Moduls „random“ führt da

Programming with Python 1

Bild
In this part of our Python tutorial, we will program a math game in which the program offers randomly simple calculation tasks to the user. The user of the program can answer it either wrong or correct. The program will output the number of attempts in the console after the calculation. So that we can write the code flawlessly, we need some basics that we have to repeat as we learned in the Java programming language. Variables and operators To store values variables are needed. Variables in Python, as well as in all programming languages, serve as placeholders as in mathematics. Operators are used to perform calculations. Calculation and assignment The following program performs a simple calculation using an operator. The result of the calculation is then output in the console. We can also write it as a program and secure it. Of course, the program would only serve for a specific bill. The output of the program is as follows: As we can see, the p