In a make task you use the skills you have learned to create a program from scratch. There is no starter code: you begin with an empty editor.
You are going to write a room finder for a school timetable. A student tells it their name and which subject they are studying, and it answers with the room that class is in.
print, exactly as written below,
followed by an input() on the next line.Computing is in room 401Maths is in room 210English is in room 105Science is in room 312if for the first subject, an elif for each of the three that follow
it, and an else for every other subject.Ask the two questions with their own print, exactly as written, in this
order:
What is your name?Which subject are you studying?Both questions are part of the checked output, so spelling, capital letters and punctuation count.
For a subject that is in the timetable, print a line worded exactly like this.
NAME stands for whatever the user typed as their name, ROOM for the room
number from the list above, and SUBJECT for the subject the user typed:
Hi NAME, go to room ROOM for SUBJECT
For any other subject, print this line instead:
I don't know which room that class is in
Python compares text exactly as it is typed, so Computing and computing are
not the same string. The subject has to be typed exactly as it is written in the
list above, with its capital letter. A subject typed any other way is one your
program does not know, so it answers with the
I don't know which room that class is in line. Compare the subject with ==
and leave it at that: do not try to make the comparison ignore capital letters.
Input:
Ben
Computing
Output:
What is your name?
Which subject are you studying?
Hi Ben, go to room 401 for Computing
Input:
Mary Jane
Maths
Output:
What is your name?
Which subject are you studying?
Hi Mary Jane, go to room 210 for Maths
Input:
Dev
History
Output:
What is your name?
Which subject are you studying?
I don't know which room that class is in
Input:
alice
computing
Output:
What is your name?
Which subject are you studying?
I don't know which room that class is in
(computing is not Computing, so this subject is not in the timetable)
Make sure that you check for the following things:
if, has as many elif branches in the middle as you
need, and ends with else.if, elif and else line.if, elif and else lines themselves are not indented.if and each elif.else.==) to compare the subject. A single =
stores data in a variable.+ between each string and variable that needs concatenating.