| | |
Input /variable...
![]() |
•
•
Join Date: Nov 2009
Posts: 4
Reputation:
Solved Threads: 0
Hi,
I am new at Python..i have been asked to create a code for the following item.
A user needs to input the 'room number' and 'date' to equal a answer.
Room Number: R1, R2, R3, R4, R5
R1 = Dates: 1/01/2000, 01/02/2000, 01/03/2000
R2 = Dates: 01/01/2000, 01/03/2000
R3 = Dates: 0/01/2000, 0/01/2000, 0/01/2000
R4 = Dates: 0/01/2000, 0/01/2000, 0/01/2000
R5 = Dates: 0/01/2000, 0/01/2000
R1 01/01/2000 Library1
R1 01/02/2000 Library2
R1 01/03/2000 Class1
R2 01/01/2000 Library2
R2 01/02/2000 Library1
R2 01/03/2000 Class2
R3 01/02/2000 Library3
R3 01/03/2000 Class3
R4 01/03/200 Class4
R5 01/01/2000 Class4
R5 01/02/2000 Library4
What do you start doing first the Input, Define method first??
I am new at Python..i have been asked to create a code for the following item.
A user needs to input the 'room number' and 'date' to equal a answer.
Room Number: R1, R2, R3, R4, R5
R1 = Dates: 1/01/2000, 01/02/2000, 01/03/2000
R2 = Dates: 01/01/2000, 01/03/2000
R3 = Dates: 0/01/2000, 0/01/2000, 0/01/2000
R4 = Dates: 0/01/2000, 0/01/2000, 0/01/2000
R5 = Dates: 0/01/2000, 0/01/2000
R1 01/01/2000 Library1
R1 01/02/2000 Library2
R1 01/03/2000 Class1
R2 01/01/2000 Library2
R2 01/02/2000 Library1
R2 01/03/2000 Class2
R3 01/02/2000 Library3
R3 01/03/2000 Class3
R4 01/03/200 Class4
R5 01/01/2000 Class4
R5 01/02/2000 Library4
What do you start doing first the Input, Define method first??
•
•
Join Date: Nov 2007
Posts: 141
Reputation:
Solved Threads: 32
0
#3 25 Days Ago
I think on programs like this you need to start by thinking about how it should look to the end user. What do you want the program to ask for and what do you want it to respond with.
Then I like to start by breaking it down into smaller parts. First, I'm just going to collect my input like Vegaseat said up above. So write up some code that collects the input and then just prints it back out. Once you've got that working, then put in some code that processes some of the data. Once you've got that working, then you should have a pretty good idea of what functions you need to define so that you can perform that process on all of the users input.
Do you need more specific help on this assignment? Is there a particular thing that you're not understanding? I think the hardest programs are the ones where you don't know where to start.
Then I like to start by breaking it down into smaller parts. First, I'm just going to collect my input like Vegaseat said up above. So write up some code that collects the input and then just prints it back out. Once you've got that working, then put in some code that processes some of the data. Once you've got that working, then you should have a pretty good idea of what functions you need to define so that you can perform that process on all of the users input.
Do you need more specific help on this assignment? Is there a particular thing that you're not understanding? I think the hardest programs are the ones where you don't know where to start.
•
•
Join Date: Dec 2006
Posts: 1,008
Reputation:
Solved Threads: 285
0
#7 25 Days Ago
Since you are using python 2.x, this won't work. Test this code by entering "R1" and "1/01/2000" and see what happens ( and look at "Is there an easy way to do user input in python?" here http://www.faqts.com/knowledge_base/index.phtml/fid/245 ).
Python Syntax (Toggle Plain Text)
def results (): roomnumber = input ("Enter Room Number: ") date = input (" Enter the Date: ") print roomnumber + date
Linux counter #99383
•
•
Join Date: Nov 2009
Posts: 4
Reputation:
Solved Threads: 0
0
#8 24 Days Ago
What about the next part?
I am trying to create the table above i.e if the user inputs R1 and the 01/01/2000 then will bring up the class(1,2,3 etc) or library(1,2,3etc).
Could i use something like:
roomnumber = {'L1': '01/01/2000', '01/02/2000' etc
or do i have to do it differently? I am trying to process the data that is being entered...
I am trying to create the table above i.e if the user inputs R1 and the 01/01/2000 then will bring up the class(1,2,3 etc) or library(1,2,3etc).
Could i use something like:
roomnumber = {'L1': '01/01/2000', '01/02/2000' etc
or do i have to do it differently? I am trying to process the data that is being entered...
Last edited by python123; 24 Days Ago at 4:37 pm. Reason: more info
![]() |
Other Threads in the Python Forum
- Previous Thread: Pygame question
- Next Thread: pygame and livewires, small problem
| Thread Tools | Search this Thread |
abrupt alarm ansi anti approximation assignment avogadro backend beginner binary bluetooth calculator character cmd code customdialog cx-freeze data decimals dictionaries dictionary directory dynamic error examples exe file float format function gnu graphics gui halp heads homework http ideas import input java launcher leftmouse line linux list lists loop module mouse number numbers output parsing path pointer port prime programming progressbar projects push py2exe pygame pyglet pyqt python random recursion schedule screensaverloopinactive script scrolledtext sqlite statistics string strings sudokusolver sum table terminal text thread threading time tlapse tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable ventrilo wikipedia write wxpython xlib






