Daylight saving time. Assignment

Vergelijkbare documenten
Calculator spelling. Assignment

Zoemzinnen. Algemene info. Functies met een variabel aantal argumenten

Luister alsjeblieft naar een opname als je de vragen beantwoordt of speel de stukken zelf!

Classification of triangles

RECEPTEERKUNDE: PRODUCTZORG EN BEREIDING VAN GENEESMIDDELEN (DUTCH EDITION) FROM BOHN STAFLEU VAN LOGHUM

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE

MyDHL+ Van Non-Corporate naar Corporate

NEDERLANDS. Display Instructies. Knoppen. Geeft afwisselend Tijd, Datum en Temperatuur weer, kan ook ingesteld worden op enkel tijd

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE. Toets Inleiding Kansrekening 1 8 februari 2010

After that, the digits are written after each other: first the row numbers, followed by the column numbers.

My Inspiration I got my inspiration from a lamp that I already had made 2 years ago. The lamp is the you can see on the right.

Quality requirements concerning the packaging of oak lumber of Houthandel Wijers vof ( )

ANGSTSTOORNISSEN EN HYPOCHONDRIE: DIAGNOSTIEK EN BEHANDELING (DUTCH EDITION) FROM BOHN STAFLEU VAN LOGHUM

Demultiplexing reads FASTA format genome sequencing reads run

ALGORITMIEK: answers exercise class 7

Handleiding Zuludesk Parent

THE LANGUAGE SURVIVAL GUIDE

The first line of the input contains an integer $t \in \mathbb{n}$. This is followed by $t$ lines of text. This text consists of:

ANT S KINGDOM Here is some advice for setting up your Master Ant Farm!

Installatie van Windows 10 op laptops. Windows 10 installation on laptops

VOORZETSELS. EXERCISE 1 Bestudeer de bovenstaande voorzetsels en zinnen goed!

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE

BISL EEN FRAMEWORK VOOR BUSINESS INFORMATIEMANAGEMENT (DUTCH LANGUAGE) (GERMAN EDITION) (DUTCH EDITION) BY REMKO VAN DER POLS, RALPH DONA

Settings for the C100BRS4 MAC Address Spoofing with cable Internet.

OUTDOOR HD BULLET IP CAMERA PRODUCT MANUAL

Alistair LED stairwell luminaire Handleiding Alistair (UC03 sensor)

Academisch schrijven Inleiding

Group work to study a new subject.

1. will + hele werkwoord (Future Simple) 2. shall + hele werkwoord 3. to be (am/is/are) going to + hele werkwoord

NBB Scheidsrechtersstage 3 september Onsportieve fout Flop Interpretaties. Nieuwe regels en signalen. Flop/fake

Add the standing fingers to get the tens and multiply the closed fingers to get the units.

Introductie in flowcharts

Four-card problem. Input

3 I always love to do the shopping. A Yes I do! B No! I hate supermarkets. C Sometimes. When my mother lets me buy chocolate.

Travel Survey Questionnaires

Het beheren van mijn Tungsten Network Portal account NL 1 Manage my Tungsten Network Portal account EN 14

MyDHL+ Tarief berekenen

General info on using shopping carts with Ingenico epayments

Academisch schrijven Inleiding

Grammatica overzicht Theme 5+6

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE

Procedure Reset tv-toestellen:

SAMPLE 11 = + 11 = + + Exploring Combinations of Ten + + = = + + = + = = + = = 11. Step Up. Step Ahead

L.Net s88sd16-n aansluitingen en programmering.

20 twenty. test. This is a list of things that you can find in a house. Circle the things that you can find in the tree house in the text.

DALISOFT. 33. Configuring DALI ballasts with the TDS20620V2 DALI Tool. Connect the TDS20620V2. Start DALISOFT

LONDEN MET 21 GEVARIEERDE STADSWANDELINGEN 480 PAGINAS WAARDEVOLE INFORMATIE RUIM 300 FOTOS KAARTEN EN PLATTEGRONDEN

Opgave 2 Geef een korte uitleg van elk van de volgende concepten: De Yield-to-Maturity of a coupon bond.

Spaarloon-, Levensloopregeling en de plannen rond het vitaliteitssparen

Alistair LED stairwell luminaire Handleiding Alistair (Emergency UC03 sensor)

Alistair LED stairwell luminaire Handleiding Alistair (UC03 sensor)

Lichamelijke factoren als voorspeller voor psychisch. en lichamelijk herstel bij anorexia nervosa. Physical factors as predictors of psychological and

L.Net s88sd16-n aansluitingen en programmering.

Example. >>> rowkey('u') 1 >>> rowkey('a') 2 >>> rowkey('z') 3 >>> rowkey('?')

Intermax backup exclusion files

Hidato. Assignment. A hidato (left) and its solution (right).

Esther Lee-Varisco Matt Zhang

HANDBOEK HARTFALEN (DUTCH EDITION) FROM BOHN STAFLEU VAN LOGHUM

Preschool Kindergarten

Interface tussen Stuurbediening en Sony autoaudio

NMOZTMKUDLVDKECVLKBVESBKHWIDKPDF-WWUS Page File Size 9,952 KB 29 May, 2016

Concept of Feedback. P.S. Gandhi Mechanical Engineering IIT Bombay

De grondbeginselen der Nederlandsche spelling / Regeling der spelling voor het woordenboek der Nederlandsche taal (Dutch Edition)

This appendix lists all the messages that the DRS may send to a registrant's administrative contact.

Het is geen open boek tentamen. Wel mag gebruik gemaakt worden van een A4- tje met eigen aantekeningen.

CHROMA STANDAARDREEKS

Win a meet and greet with Adam Young from the band Owl City!

Shipment Centre EU Quick Print Client handleiding [NL]

It s all about the money Group work

CTI SUITE TSP DETAILS

Geert Mul (Nederlandse tekst onderaan de pagina)

Vertaling Engels Gedicht / songteksten

LDA Topic Modeling. Informa5ekunde als hulpwetenschap. 9 maart 2015

irregular verbs onregelmatige werkwoorden

B1 Woordkennis: Spelling

Illustrator Tutorial - How to Create a Watch

1. Select design and sketches 2. Model making 3. Tent construction 4. Welding 5. Paper mache 6. Painting 7. picking flowers (Dahlia s) 8.

Het Effect van Verschil in Sociale Invloed van Ouders en Vrienden op het Alcoholgebruik van Adolescenten.

2000 Volkswagen Passat GLS

(1) De hoofdfunctie van ons gezelschap is het aanbieden van onderwijs. (2) Ons gezelschap is er om kunsteducatie te verbeteren

OPEN TRAINING. Onderhandelingen met leveranciers voor aankopers. Zeker stellen dat je goed voorbereid aan de onderhandelingstafel komt.

In the classroom. Who is it? Worksheet

REIN kast. eiken standaard iepen. gebakken iepen. gerookt. licht iepen. bijzonderheden. staanders/achterwand/deur. ontwerp: Gjalt Pilat, 2005

0515 DUTCH (FOREIGN LANGUAGE)

Leeftijdcheck (NL) Age Check (EN)

OUTDOOR HD DOME IP CAMERA PRODUCT MANUAL GB - NL

1. In welk deel van de wereld ligt Nederland? 2. Wat betekent Nederland?

Hoe met Windows 8 te verbinden met NDI Remote Office (NDIRO) How to connect With Windows 8 to NDI Remote Office (NDIRO

Wij beloven je te motiveren en verbinden met andere studenten op de fiets, om zo leuk en veilig te fietsen. Benoit Dubois

Geslacht, Emotionele Ontrouw en Seksdrive. Gender, Emotional Infidelity and Sex Drive

ContentSearch. Deep dive

Transcriptie:

Daylight saving time Daylight saving time (DST or summertime) is the arrangement by which clocks are advanced by one hour in spring and moved back in autumn to make the most of seasonal daylight Spring: shift to daylight saving time. Autumn: shift to standard time. In the summer the sun rises so early that it is already light while most people are still sleeping. By shifting the clock, the sun seems to rise and to set later. This is why in the morning it is dark for longer, and in the evening it is light for longer. The period of daylight is thus more consistent with the period when most people are awake. The idea behind DST is that there could be cut back on (electric) lighting. However, the energy-saving effect of DST is controversial. Approximately 70 countries are currently changing the time on their clocks twice a year. In the European Union, the DST runs from the last Sunday in March until the last Sunday in October. The dates of the next few years the DST in the European Union begins and ends, are shown in the table below. year begin date end date 2013 31 March 27 October 2014 30 March 26 October 2015 29 March 25 October 2016 27 March 30 October 2017 26 March 29 October Assignment Write a function summertime to which a year must be passed as an argument. The function must return a date object (datetime module from the Python Standard Library), which represents the date on which the European Union enters the daylight saving time (last

Sunday of March) in the specified year. Write a function wintertime to which a year must be passed as an argument. The function must return a date object (datetime module from the Python Standard Library), which represents the date on which the European Union enters the standard time (last Sunday of October) in the specified year. Write a function clock to which a string argument must be passed, which sets a date in the format day/month/year. The function must return a string that indicates whether the clock on the specified date is in summer time or winter time. The function must return a custom string on the dates on which will be switched between summer time and winter time. The possible definitions that the function must return can be found in the example below. You can assume with every function that all years are between 1600 and 2400. In this task, it is important that you try to reuse code as much as possible and you should, where possible, thus avoid repeating a similar code. Preparation For this assignment you have to use the data types date and timedelta, which are defined in the module datetime of the Python Standard Library. The following interactive Pythonsession demonstrates all methods of the required data types: >>> from datetime import date, timedelta >>> today = date.today() >>> today datetime.date(2013, 6, 27) >>> today.weekday() 3 >>> tomorrow = today + timedelta(1) >>> tomorrow.weekday() 4 >>> tomorrow datetime.date(2013, 6, 28) Example >>> summertime(2013) datetime.date(2013, 3, 31) >>> summertime(2014) datetime.date(2014, 3, 30) >>> summertime(2015) datetime.date(2015, 3, 29) >>> wintertime(2013) datetime.date(2013, 10, 27) >>> wintertime(2014) datetime.date(2014, 10, 26) >>> wintertime(2015) datetime.date(2015, 10, 25) >>> clock('27/06/2013') 'summertime' >>> clock('27/11/2013') 'wintertime' >>> clock('31/03/2013') 'switch from wintertime to summertime'

>>> clock('27/10/2013') 'switch from summertime to wintertime' Zomertijd (in Vlaanderen ook vaak zomeruur genoemd) is de tijd die gedurende de zomermaanden wordt aangehouden door de klok een uur vooruit te zetten, dit wil zeggen de klok een uur voor te laten lopen op de standaardtijd (die in dit verband ook wel wintertijd genoemd wordt). Voorjaar: omschakeling van wintertijd naar zomertijd. Najaar: omschakeling van zomertijd naar wintertijd. In de zomer komt de zon zo vroeg op dat het al licht is terwijl de meeste mensen nog slapen. Door de klok te verzetten, lijkt de zon later op te komen en later weer onder te gaan. Hierdoor is het 's morgens langer donker, en blijft het 's avonds juist langer licht. De periode van daglicht komt zo beter overeen met de periode waarin de meeste mensen wakker zijn. De gedachte achter zomertijd is dat men zo zou kunnen bezuinigen op (elektrische) verlichting. Het energiebesparende effect van zomertijd is echter omstreden. Ongeveer 70 landen verzetten momenteel twee keer per jaar de klok. In de Europese Unie loopt de zomertijd van de laatste zondag van maart tot de laatste zondag van oktober. De datums waarop in de Europese Unie de komende jaren de zomertijd begint en eindigt, worden weergegeven in onderstaande tabel. jaar begindatum einddatum 2013 31 maart 27 oktober 2014 30 maart 26 oktober 2015 29 maart 25 oktober 2016 27 maart 30 oktober 2017 26 maart 29 oktober Opgave Schrijf een functie zomertijd waaraan een jaartal als argument moet doorgegeven worden.

De functie moet als resultaat een date object (datetime module van de Python Standard Library) teruggeven, dat de datum voorstelt waarop in de Europese Unie de zomertijd ingaat (laatste zondag van maart) in het opgegeven jaar. Schrijf een functie wintertijd waaraan een jaartal als argument moet doorgegeven worden. De functie moet als resultaat een date object (datetime module van de Python Standard Library) teruggeven, dat de datum voorstelt waarop in de Europese Unie de wintertijd ingaat (laatste zondag van oktober) in het opgegeven jaar. Schrijf een functie klok waaraan een stringargument moet doorgegeven worden, dat een datum voorstelt in het formaat dag/maand/jaar. De functie moet als resultaat een string teruggeven die aangeeft of de klok op de opgegeven datum in zomertijd of wintertijd staat. De functie moet een aangepaste string teruggeven op de datums waarop wordt overgeschakeld tussen zomertijd en wintertijd. De mogelijke omschrijvingen die de functie moet teruggeven vind je terug in onderstaande voorbeeldsessie. Je mag er bij elke functie van uitgaan dat alle jaartallen tussen 1600 en 2400 liggen. Bij deze opgave is het belangrijk dat je probeert om zoveel mogelijk hergebruik te maken van programmacode, en moet je waar mogelijk dus vermijden om gelijkaardige code te herhalen. Voorbereiding Voor deze opgave moet je gebruik maken van de gegevenstypes date en timedelta die gedefinieerd worden in de module datetime van de Python Standard Library. Onderstaande interactieve Pythonsessie demonstreert alle methoden van deze gegevenstypes die je voor deze opgave nodig hebt: >>> from datetime import date, timedelta >>> vandaag = date.today() >>> vandaag datetime.date(2013, 6, 27) >>> vandaag.weekday() 3 >>> morgen = vandaag + timedelta(1) >>> morgen.weekday() 4 >>> morgen datetime.date(2013, 6, 28) Voorbeeld >>> zomertijd(2013) datetime.date(2013, 3, 31) >>> zomertijd(2014) datetime.date(2014, 3, 30) >>> zomertijd(2015) datetime.date(2015, 3, 29) >>> wintertijd(2013) datetime.date(2013, 10, 27) >>> wintertijd(2014) datetime.date(2014, 10, 26) >>> wintertijd(2015) datetime.date(2015, 10, 25) >>> klok('27/06/2013')

'zomertijd' >>> klok('27/11/2013') 'wintertijd' >>> klok('31/03/2013') 'omschakeling van wintertijd naar zomertijd' >>> klok('27/10/2013') 'omschakeling van zomertijd naar wintertijd'