From 8d8d2dc81daf8611df4bdf6f6755cff982df9a65 Mon Sep 17 00:00:00 2001 From: Fredrik Berggren Date: Sat, 22 Feb 2020 08:56:02 +0100 Subject: [PATCH 1/2] starting to translate text to swedish, rename of folder --- src/getting_started/python_syntax.md | 49 --------------------------- src/getting_started/test_variables.py | 38 --------------------- src/getting_started/what_is_python.md | 37 -------------------- 3 files changed, 124 deletions(-) delete mode 100644 src/getting_started/python_syntax.md delete mode 100644 src/getting_started/test_variables.py delete mode 100644 src/getting_started/what_is_python.md diff --git a/src/getting_started/python_syntax.md b/src/getting_started/python_syntax.md deleted file mode 100644 index 62dd5be7..00000000 --- a/src/getting_started/python_syntax.md +++ /dev/null @@ -1,49 +0,0 @@ -# Python Syntax - -**Python Syntax compared to other programming languages** - -- Python was designed to for readability, and has some similarities to the English language with influence from mathematics. -- Python uses new lines to complete a command, as opposed to other programming languages which often use semicolons or parentheses. -- Python relies on indentation, using whitespace, to define scope; such as the scope of loops, functions and classes. Other programming languages often use curly-brackets for this purpose. - -## Python Indentations - -Where in other programming languages the indentation in code is for readability only, in Python the indentation is very important. - -Python uses indentation to indicate a block of code. - -```python -if 5 > 2: - print("Five is greater than two!") -``` - -Python will give you an error if you skip the indentation. - -## Comments - -Python has commenting capability for the purpose of in-code documentation. - -Comments start with a `#`, and Python will render the rest of the line as a comment: - -```python -#This is a comment. -print("Hello, World!") -``` - -## Docstrings - -Python also has extended documentation capability, called docstrings. - -Docstrings can be one line, or multiline. Docstrings are also comments: - -Python uses triple quotes at the beginning and end of the docstring: - -```python -"""This is a -multiline docstring.""" -print("Hello, World!") -``` - -## References - -- [w3schools.com](https://www.w3schools.com/python/python_syntax.asp) diff --git a/src/getting_started/test_variables.py b/src/getting_started/test_variables.py deleted file mode 100644 index d41e777a..00000000 --- a/src/getting_started/test_variables.py +++ /dev/null @@ -1,38 +0,0 @@ -"""Variables - -@see: https://docs.python.org/3/tutorial/introduction.html -@see: https://www.w3schools.com/python/python_variables.asp -@see: https://www.learnpython.org/en/Variables_and_Types - -Python is completely object oriented, and not "statically typed". -You do not need to declare variables before using them, or declare -their type. Every variable in Python is an object. - -Unlike other programming languages, Python has no command for -declaring a variable. A variable is created the moment you first assign -a value to it. - -A variable can have a short name (like x and y) or a more descriptive name -(age, carname, total_volume). - -Rules for Python variables: -- A variable name must start with a letter or the underscore character. -- A variable name cannot start with a number. -- A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ ). -- Variable names are case-sensitive (age, Age and AGE are three different variables). -""" - - -def test_variables(): - """Test variables""" - - integer_variable = 5 - string_variable = 'John' - - assert integer_variable == 5 - assert string_variable == 'John' - - variable_with_changed_type = 4 # x is of type int - variable_with_changed_type = 'Sally' # x is now of type str - - assert variable_with_changed_type == 'Sally' diff --git a/src/getting_started/what_is_python.md b/src/getting_started/what_is_python.md deleted file mode 100644 index 391327e9..00000000 --- a/src/getting_started/what_is_python.md +++ /dev/null @@ -1,37 +0,0 @@ -# What is Python - -Python is a popular programming language. It was created in 1991 by Guido van Rossum. - -Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms. - -It is used for: - -- web development (server-side), -- software development, -- mathematics, -- system scripting. - -## What can Python do? - -- Python can be used on a server to create web applications. -- Python can be used alongside software to create workflows. -- Python can connect to database systems. It can also read and modify files. -- Python can be used to handle big data and perform complex mathematics. -- Python can be used for rapid prototyping, or for production-ready software development. - -## Why Python? - -- Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc). -- Python has a simple syntax similar to the English language. -- Python has syntax that allows developers to write programs with fewer lines than some other programming languages. -- Python runs on an interpreter system, meaning that code can be executed as soon as it is written. This means that prototyping can be very quick. -- Python can be treated in a procedural way, an object-orientated way or a functional way. - -## Good to know - -- The most recent major version of Python is Python 3, which we shall be using in this tutorial. However, Python 2, although not being updated with anything other than security updates, is still quite popular. -- In this tutorial Python will be written in a text editor. It is possible to write Python in an Integrated Development Environment, such as Thonny, Pycharm, Netbeans or Eclipse which are particularly useful when managing larger collections of Python files. - -## References - -- [w3schools.com](https://www.w3schools.com/python/python_intro.asp) \ No newline at end of file From 98afc5bf0fb07f8691ca8d676e32ae9b6e6adf9a Mon Sep 17 00:00:00 2001 From: Fredrik Berggren Date: Sat, 22 Feb 2020 08:57:24 +0100 Subject: [PATCH 2/2] adding intro folder --- src/introduktion/python_syntax.md | 49 ++++++++++++++++++++++ src/introduktion/test_variables.py | 38 +++++++++++++++++ "src/introduktion/vad \303\244r python.md" | 37 ++++++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 src/introduktion/python_syntax.md create mode 100644 src/introduktion/test_variables.py create mode 100644 "src/introduktion/vad \303\244r python.md" diff --git a/src/introduktion/python_syntax.md b/src/introduktion/python_syntax.md new file mode 100644 index 00000000..62dd5be7 --- /dev/null +++ b/src/introduktion/python_syntax.md @@ -0,0 +1,49 @@ +# Python Syntax + +**Python Syntax compared to other programming languages** + +- Python was designed to for readability, and has some similarities to the English language with influence from mathematics. +- Python uses new lines to complete a command, as opposed to other programming languages which often use semicolons or parentheses. +- Python relies on indentation, using whitespace, to define scope; such as the scope of loops, functions and classes. Other programming languages often use curly-brackets for this purpose. + +## Python Indentations + +Where in other programming languages the indentation in code is for readability only, in Python the indentation is very important. + +Python uses indentation to indicate a block of code. + +```python +if 5 > 2: + print("Five is greater than two!") +``` + +Python will give you an error if you skip the indentation. + +## Comments + +Python has commenting capability for the purpose of in-code documentation. + +Comments start with a `#`, and Python will render the rest of the line as a comment: + +```python +#This is a comment. +print("Hello, World!") +``` + +## Docstrings + +Python also has extended documentation capability, called docstrings. + +Docstrings can be one line, or multiline. Docstrings are also comments: + +Python uses triple quotes at the beginning and end of the docstring: + +```python +"""This is a +multiline docstring.""" +print("Hello, World!") +``` + +## References + +- [w3schools.com](https://www.w3schools.com/python/python_syntax.asp) diff --git a/src/introduktion/test_variables.py b/src/introduktion/test_variables.py new file mode 100644 index 00000000..d41e777a --- /dev/null +++ b/src/introduktion/test_variables.py @@ -0,0 +1,38 @@ +"""Variables + +@see: https://docs.python.org/3/tutorial/introduction.html +@see: https://www.w3schools.com/python/python_variables.asp +@see: https://www.learnpython.org/en/Variables_and_Types + +Python is completely object oriented, and not "statically typed". +You do not need to declare variables before using them, or declare +their type. Every variable in Python is an object. + +Unlike other programming languages, Python has no command for +declaring a variable. A variable is created the moment you first assign +a value to it. + +A variable can have a short name (like x and y) or a more descriptive name +(age, carname, total_volume). + +Rules for Python variables: +- A variable name must start with a letter or the underscore character. +- A variable name cannot start with a number. +- A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ ). +- Variable names are case-sensitive (age, Age and AGE are three different variables). +""" + + +def test_variables(): + """Test variables""" + + integer_variable = 5 + string_variable = 'John' + + assert integer_variable == 5 + assert string_variable == 'John' + + variable_with_changed_type = 4 # x is of type int + variable_with_changed_type = 'Sally' # x is now of type str + + assert variable_with_changed_type == 'Sally' diff --git "a/src/introduktion/vad \303\244r python.md" "b/src/introduktion/vad \303\244r python.md" new file mode 100644 index 00000000..391327e9 --- /dev/null +++ "b/src/introduktion/vad \303\244r python.md" @@ -0,0 +1,37 @@ +# What is Python + +Python is a popular programming language. It was created in 1991 by Guido van Rossum. + +Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms. + +It is used for: + +- web development (server-side), +- software development, +- mathematics, +- system scripting. + +## What can Python do? + +- Python can be used on a server to create web applications. +- Python can be used alongside software to create workflows. +- Python can connect to database systems. It can also read and modify files. +- Python can be used to handle big data and perform complex mathematics. +- Python can be used for rapid prototyping, or for production-ready software development. + +## Why Python? + +- Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc). +- Python has a simple syntax similar to the English language. +- Python has syntax that allows developers to write programs with fewer lines than some other programming languages. +- Python runs on an interpreter system, meaning that code can be executed as soon as it is written. This means that prototyping can be very quick. +- Python can be treated in a procedural way, an object-orientated way or a functional way. + +## Good to know + +- The most recent major version of Python is Python 3, which we shall be using in this tutorial. However, Python 2, although not being updated with anything other than security updates, is still quite popular. +- In this tutorial Python will be written in a text editor. It is possible to write Python in an Integrated Development Environment, such as Thonny, Pycharm, Netbeans or Eclipse which are particularly useful when managing larger collections of Python files. + +## References + +- [w3schools.com](https://www.w3schools.com/python/python_intro.asp) \ No newline at end of file