harmaja | Experimental frontend framework | Frontend Framework library
kandi X-RAY | harmaja Summary
kandi X-RAY | harmaja Summary
An experimental web frontend framework named after a lighthouse. It maybe easiest to describe it in contrast to React. Published on NPM: The documentation here is lacking, and it will help if you're already familiar with Redux, Calmm.js and Bacon.js (or other reactive library such as RxJs). This document contains a lot of discussion on state management concepts such as unidirectional data flow, as well as existing implementations that I'm aware of. I present my views on these topics openly, with the goal to paint the whole picture of how I see application state management. So don't expect this to be a focused API document, but more like a research project. I'm very open to discussion and criticism so correct me if I'm wrong. On the other hand, I hope you to understand that many topics here are subjective and I'm presenting my own views of the day.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of harmaja
harmaja Key Features
harmaja Examples and Code Snippets
Community Discussions
Trending Discussions on harmaja
QUESTION
Sorry, I'm not quite sure how to describe my issue.
For an online python course I'm following there's an exercise I can't figure out. (raise NotImplementedError() refers to lines I need to input code).
The line of code station_years = 2019 - station_start_years[selected_station]
is what I'm stuck on. I'm aiming for the list "station_start_years" to chose its value based on my selected_station value, which is based on station_names.
num = int(input('select a station: '))
was inserted by me so may be wrong.
Thanks for any help, I've read through the exercises but am lost.
Read-only code cellstation_names = ['Harmaja', 'Kaisaniemi', 'Kaivopuisto', 'Kumpula', 'lighthouse', 'Malmi airfield', 'Suomenlinna aaltopoiju', 'Vuosaari harbour']
station_start_years = [1989, 1844, 1904, 2005, 2003, 1937, 2016, 2012]
Below we can define the selected station: #raise NotImplementedError()
num = int(input('select a station: '))
selected_station = station_names[num]
Next we find the location of the selected station in the list of station names:
Read-only code cellstation_index = station_names.index(selected_station)
Now we can calculate the years the station has been operational:
YOUR CODE HEREraise NotImplementedError()
station_years = 2019 - station_start_years[selected_station]
Now, we can print the station name and number of years of operation to the screen.
A sample print statement on screen is 'The Helsinki Harmaja station has been operational for 30 years.'
The print statements should work for all listed stations only by modifying the selected_station
-variable that is defined earlier in this problem.
raise NotImplementedError()
ANSWER
Answered 2020-Mar-07 at 11:34You find the index of selected_station
in station_names
but then you use selected_station
(which is the name of the station) to index your station_start_years
list. You should be using station_index
there:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install harmaja
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page