FORDERN AND FÖRDERN

fordern – to demand

Beim Fußball ist hoher Einsatz und hohes Engagement gefordert

Ich fordere eine Erklärung von dir.

Die Telekom fordert 100 Euro von mir.

fordern conjugation

Ich fordere
Du forderst
Er/es/sie fordert
Wir fordern
Ihr fordert
Sie / sie fordern
Präteritum ich forderte
Perfekt ich habe gefordert

Prefixes of fordern:

anfordern – request

Der Kongress forderte weitere Informationen an.

Wenn wir ihn anfordern, kann er in fünf bis zehn Minuten hier sein.

auffordern – invite, prompt

Lisa hat mich zum Tanz aufgefordert.

Ich fordere Sie zur Rückzahlung der geliehenen Summe auf.

unterfordern – unchallenged (under-demanded)

Er will die Jüngeren nicht unterfordern.

Joshua fühlt sich von seinem Praktikum unterfordert.

überfordert – overburden

Marias Schwester ist mit den 2 Jobs und den 5 Kindern überfordert.

Man darf Kinder nicht mit so schweren Aufgaben überfordern.

herausfordern – to challenge / dare

Ich fordere dich zum Kampf heraus.

Ivan sollte das Schicksal lieber nicht herausfordern.

erfordern – require

Dein Plan erfordert eine große Summe Geldes.

Eine Diät erfordert nur ein bisschen Disziplin – aber das Rauchen aufzuhören erfordert einen eisernen Willen.

fördern- to support, promote, foster

Die Stadtverwaltung hat auch viele Kunstprojekte gefördert.

Die Regierung will den Tourismus fördern.

befördern – advance, forward

Die Seilbahn befördert uns auf den Berg.

Die Rakete befördert den Satelliten ins All.

German compound words with Zeug

Compound words in German are formed by combining two words mostly nouns. In English compound words appear with a hypen, but in German it appears as a single word.

das Zeug – things or stuffs.

Das war also interessantes Zeugs

Packt das Zeug weg.

der Zeuge / die Zeugin – witness

Ich war Zeuge eines Kults.

Der Zeuge kann sich dann zurückziehen.

das Zeugnis – report

Professor Aigner schrieb mir ein fantastisches Zeugnis.

Es stellt auch Paula ein gutes Zeugnis aus

das Flugzeug – aircraft / airplane

Das Flugzeug geht um vier.

Er wartete auf ein Flugzeug.

das Spielzeug – toys / playthings

Das ist ein Spielzeug aus Papier.

Ich verweise beispielsweise auf Spielzeug.

das Werkzeug – tools

Remi ließ das Werkzeug zu ihm hinab

Ich habe kein Werkzeug dabei

das Feuerzeug – lighter

Er zündete das Feuerzeug an.

Harry gab ihm das Feuerzeug.

das Schlagzeug – drums.

Das Schlagzeug haben wir im Keller gelassen

In der Band spielte sie normalerweise Keyboard und Schlagzeug.

das Schreibzeug – writting things

Schreibzeug und Papier haben wir nie bekommen

Auf dem Tisch lag Schreibzeug bereit, und Laincourt machte sich unverzüglich an die Arbeit.

das Fahrzeug – car / vehicle

Wir haben schon ein automatisches Fahrzeug.

Wir haben 8 Motoren in diesem Fahrzeug.

Global and local variable in Python

Python Variable:

               A variable is a container for storing data. It allows you to label and store data. Variables can store strings, numbers, lists or any other data type.

Example:

name = ‘Thomas’

name is the variable which stores the string data type.

When we write two values to the same variable, it overwrites the most recent value. For example

a = 10

a = 20

When you call a it will show 20, as it is the most recent value.

In Python Programming we will see two variables:

Global and local.

Global Variable:

               In Python, a variable which is created outside of the function is called global variable. It has scope throughout the program i.e., inside or outside the function. We can access both inside and outside of the program. It is often declared at the top of the program.

Trying to change value of Global variable inside a function:

Unbound local error is raised.

Local Variable:

               In Python, a variable inside a function is called local variable. It has scope only within the function in which is defined.

Accessing local variable outside scope:

Name error is raised.

Global Keyword:

               Global Keyword is used only when we want to change or modify the global variable outside its current scope. It is used to make change in gloabal variable in local context.

Syntax:

def f1( ):

global variable

The fundamental rules of the ‘global’ keyword are as follows:
  • When you create a variable inside the function, it is in a local context by default
  • When you create or define a variable outside the function, by default it is a global context, there’s no need for a global keyword here
  • Global keywords can be used to read or modify the global variable inside the function
  • Using a global keyword outside of the function has no use or makes no effect.
Using both Global and local variables:
Global and local variable with same name:

*args and **kwargs in Python

Why *args and **kwargs?

A function is useful in generating a reusable code. We call a function using specific arguments called function argument in Python.

Now let us try to understand its need.

For example in a simple program of multiply two numbers what will happen if we have passed three arguments instead of two.

Type error is thrown. In cases where we don’t know the no. of arguments we can use *args and **kwargs to pass variable no. of arguments.

Special Symbols for passing arguments:

Two special symbols are used in Python for passing variable no. of arguments in Python.

  • *args (Non-keyword argument)
  • **kwargs (keyword argument)

We use the * notation when we don’t know the no. of arguments.

*args:

               *args is used to pass a variable number of non-keyword arguments. * indicates the variable length of arguments. * before args denotes that arguments are passed as tuple. These arguments make tuple inside the function with same name as parameter excluding *

Using *args:

**kwargs:

               **kwargs allows us to pass a variable number of keyword arguments. ** before kwargs denotes that arguments are passed as dictionary. These arguments make dictionary inside the function with same name as parameter excluding **.

Using **kwargs:

Using both *args and **kwargs:

Argument order:

Argument order is important in function declarations, like in above example always

  • Regular arguments
  • *args
  • **kwargs

What will happen if we change order? let’s see!

Syntax error is raised.

Unpacking operator * :

The unpacking operator * is used to unpack and merge list, tuples.

Unpacking using *

Packing or merging list and tuples using *

Unpacking operator **

** is used to unpack and merge dictionaries.

Points to Note:

  • *args and **kwargs are special keywords for accepting variable number of arguments.
  • *args passes variable number of non-keyword arguments and performs operations on list, tuples
  • **kwargs passes variable number of keyword arguments and performs operations on dictionaries.
  • *args and **kwargs makes the function flexible.

How to use Generators in Python?

In Python, creating a iterator is a bit tricky, we need to implement _iter_( ) and _next_( ) method to keep track of internal states and raise StopIteration when there is no value to be returned. So in such cases, Generators are used.

What is Python Generators?

Python generator is a special type of function that returns a traversal object which is used to create iterators. In a generator function yield keyword is used rather than return.

Difference between yield and return statement

If a function contains at least one yield statement it becomes a generator function. Both yield and return will return some value from a function. But return statement terminates the function entirely whereas yield statement pauses the function temporarily holding all the internal states of the function and continues in further successive calls.

Difference between Generator function and normal function:

  • Generator function has one or more yield keywords.
  • When called, it returns a traversal object (iterator) but does not start immediately
  • Once the function yields, the function is paused and control is transferred to the caller.
  • Local variables and their states are remembered between successive calls
  • Methods like _iter_() and _next_() are implemented automatically. We can iterate using next().
  • When function terminates, StopIteration is raised automatically.
Example:

As you can see in the above example, when the function terminates, StopIteration is raised automatically.

Python Generator with a Loop:

Normally generator functions are implemented in a loop with a terminating condition.

Generator Expression:

            Simple Generators can be created on the go using Generator expressions. It’s similar to lambda expression, which creates anonymous function. Generator expression also creates anonymous function.

            Syntax is like list comprehension in Python. But instead of a square bracket round parentheses is used. The list comprehension calculates entire list whereas generator expression calculates one at a time.

Advantages:

  • Easy to implement
  • Memory efficient
  • Represent infinite sequence
  • Pipelining with generators.

Verben mit Präfixen – machen

machen – to make / to do

machen conjugation:

PräsensPerfekt
ich macheich habe gemacht
du machstdu hast gemacht
er machter hat gemacht
wir machenwir haben gemacht
ihr machtihr habt gemacht
sie machensie haben gemacht

Example:

Was machst du?

Er hat seine Arbeit gut gemacht.

Die Kinder machten viel Lärm.

machen und Präfixen

anmachen – switch on / turn on

Ich mache das Licht an.

Können Sie bitte das Radio anmachen?

Ich mache den Salat mit Zitrone an.

ausmachen – switch off / turn off

Ich mache den Fernseher aus.

Mach bitte das Licht aus!

Wir machen das Radio aus.

aufmachen – to open

Machen Sie bitte das Lehrbuch auf der Seite 12 auf!

Thomas hat die Tür aufgemacht.

Kann ich das Fenster aufmachen?

zumachen – to close / to shut

Können Sie bitte die Tür zumachen?

Samstags machen die Geschäfte um 14Uhr zu.

Ich möchte, dass du die Augen zumachst.

abmachen – to arrange / settle

Wir haben abgemacht, dass wir uns um 12Uhr Treffen.

Ich muss das hier abmachen.

nachmachen – to reproduce / to simulate

Thomas macht mir alles nach.

Das kann niemand nachmachen

vermachen – to will

In seinem Testament vermachte er seiner Frau ein Vermögen.

Er hat seinem Sohn ein Vermögen vermacht.

mitmachen – to participate / to join

Ich sage dir, da machst du was mit.

Ich werde beim Marathon mitmachen.

There are few more prefixes for machen. If you know any of them, let me know.

Map(), reduce() and filter() functions in Python

Map, reduce and filter are paradigms of functional programming. These helps in writing simple, short codes without worrying about iterations like loops and branching.

Functional Programming:

A Programming paradigm that uses functions to define a computation is known as functional programming. One important feature is concept of unchangeable state. This works only on immutable data types, we only work on copies of original data structure. Map, reduce and filter in python create and work with copy of data set leaving the original data set intact.

Higher – Order Functions:

               These take functions as parameter and returns functions as result. Map(), reduce() and filter() are three most useful higher-order functions in Python. They can do complex operations when combined with simpler functions.

Map and filter are built-in functions and doesn’t require importing. Reduce resides in functools module so requires importing.

map():

map() function returns a map object ( which is an iterator or generator object) of the results after applying the given function to each item of a given iterable (list, tuple…,)

Syntax:

map (func, *iterables)

func: It is a function to which map passes each element of given iterable.

Iterables: It is to be mapped.

You can pass one or more iterables to the map function.

It returns the list of results after applying the given function to each of the given iterables ( list, tuples, hash tables etc.,)

The returned value from map() (map object) then can be passed to list ( to create a list), set ( to create a set).

Example:

Using lambda expression for the above code.

Adding two lists using map and lambda:

filter():

               filter() method filters the given sequence with the help of a function that tests each element in the sequence to be true or not.

Syntax:

filter(func, iterables)

Parameters:

function: function that tests if each element of a

sequence true or not.

sequence: sequence which needs to be filtered, it can be sets, lists, tuples, or containers of any iterators.

Returns:

returns an iterator that is already filtered.

Example:

Using lambda expression:

reduce():

reduce() function applies the provided function to the iterables and returns single value as result.

Syntax:

reduce(function, iterables)

The function specifies which expression should be applied to the ‘iterables’ in this case. The function tools module must be used to import this function.

Example:

Using lambda expression:

These are the most powerful higher order functions in python.

Higher Order Functions and decorators in Python

Higher Order Functions:

Higher Order Functions (HOFs) are functions that express complex concepts by combining simpler functions into a new function. It is a function that contains a function as parameter and returns another function as a result.

Properties of Higher Order Functions:

  1. We can store a function inside a variable.
  2. A function can act as instance of an object
  3. We can pass a function as an argument to another function
  4. We can store Python higher order functions in data structures such as list, hash tables etc.,

Functions as object:

               In Python, a function can be assigned to a variable. Here, a reference to the function is created.

Example:

Passing Function as an argument to another function:

Functions are like objects in Python, so they can be passed as an argument to another function.

Returning Function:

As functions are objects, we can also return a function from another function.

Decorators as Higher Order Function:

               We can use decorators as higher order function. Decorators in Python allow us to extend behavior of methods or functions without explicitly modifying it.

Decorators allow us to wrap another function to extend the behavior of wrapped function, without modifying it.

Syntax:

# Using a decorator  

@myDecorator  

def Python_Decorator():   

.

.

The above decorator syntax is equivalent to the below syntax for using decorator as higher order function in python.

def Python_Decorator():   

    .  

    .  

Python_Decorator = @myDecorator(Python_Decorator)  

Example:

In the next article we will see about map(), reduce() and filter() higher order functions.

8 German Expressions you must know!

Typisch Deutsch : Redewendungen

1. Das ist mir Wurst.

Literally: This is sausage to me.

Meaning: I don’t care

2. Nur Bahnhof verstehen.

Literally: Only understand the train station

Meaning: No idea / I don’t understand anything.

3. Jemanden die Daumen drücken

Literally: To press your thumbs for someone.

Meaning: Wishing someone good luck

4. Ich glaub’ ich spinne.

Litterally: I believe I spider

Meaning: I think am going crazy.

5. Ich bin fix und fertig

Literally: I am fixed and finished

Meaning: I am wiped out / tierd.

6. Ich habe die Nase voll

Literally: I have the nose full

Meaning: I am fed up with it.

7. Lass’ die Kirche im Dorf

Literally: Leave the church in the village

Meaning: Don’t get carried away

8. Du hast die Qual der Wahl.

Literally: You have the agony of choice

Meaning: When you have many options, its harder to choose.

If you are interested in expressions that comes with schwein, click the link below:

5 Popular German idioms with Schwein

5 meanings of the German word ‘IHR’

1. ihr = her

Possessivpronomen IHR im Singular

Ist das ihr Vater?

Hast du ihr Auto gesehen?

2. ihr = their

Possessivpronomen IHR im Plural

Ist das ihr Bruder?

Das sind meine Eltern. Und das ist ihr Haus.

3. ihr = you

Personalpronomen IHR im Singular

Wohin geht ihr?

4. ihr = her

Personalpronomen IHR im Dativ (Singular)

Ich kaufe ihr ein Auto.

Ich helfe ihr

5. Ihr = your

Possessivepronomen IHR (formell)

Ist das Ihre Tasche?

Wie ist Ihre Name?