Program to print: Last Name, ID, Mobile Number, All - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Homework (https://python-forum.io/forum-9.html) +--- Thread: Program to print: Last Name, ID, Mobile Number, All (/thread-2187.html) Pages:
1
2
|
Program to print: Last Name, ID, Mobile Number, All - panick1992 - Feb-24-2017 Hello guys, I would appreciate if anybody could help me start this homework (im not asking for someone to solve it just to keep in mind) A variable “personal_details” is given, declared by the details of a group of some persons. The data of each person separated by the symbol ':' while the persons are separated by the symbol ';' personal_details = "Andrew Ratcliffe:111111:07777777777;Michael Burton :22222222: 07888888888;" So I need to develop a program that will ask the first name of the person and then to print what you asked for or to print all the details of each person. In case if the name of the person is not exist then the program should display the necessary message (i.e There is no such person registered) Examples: · First example (hint: with bold is the data entry): Give the name of the person you are looking for: Andrew Select Data 1) Surame 2) Nr. ID 3) Nr. Mobile 4) All: 1 Andrew Ratcliffe · Second example: Give the name of the person you are looking for: Andrew Select Data 1) Surname 2) Nr. ID 3) Nr. Mobile 4) All: 4 Andrew Ratcliffe 111111 Ratcliffe 07777777777 · Third Example: Give the name of the person you are looking for: Andrew There is no such person registered (Andrew) RE: Program to print: Last Name, ID, Mobile Number, All - Larz60+ - Feb-24-2017 Quote:So I need to develop a program that will ask the first name of the person and then to print what you asked for or to print all the details of each person.
RE: Program to print: Last Name, ID, Mobile Number, All - panick1992 - Feb-24-2017 Larz60+ so this is actualy the code? RE: Program to print: Last Name, ID, Mobile Number, All - micseydel - Feb-24-2017 (Feb-24-2017, 08:09 PM)panick1992 Wrote: Larz60+ so this is actualy the code?Definitely not. You can see that yourself if you tried running it :) RE: Program to print: Last Name, ID, Mobile Number, All - panick1992 - Feb-24-2017 Lazar60+ Can I send you a pm please? I have more questions if you have the time to help me RE: Program to print: Last Name, ID, Mobile Number, All - micseydel - Feb-24-2017 We don't want to help people over PMs. Post some code (minimal, runnable) and ask a specific question to increase the chance of a high quality answer. See https://python-forum.io/misc.php?action=help for more info RE: Program to print: Last Name, ID, Mobile Number, All - panick1992 - Feb-24-2017 Actually I do not know how to do it. This is what I have done until now: def personal_details(): return "Andrew Ratcliffe:111111:07777777777;Michael Burton :22222222: 07888888888;" personal_details() print (input('Enter the name: ')) print ('\n') print (input( Select Data 1) Surame 2) Nr. ID 3) Nr. Mobile 4) All: ')) return "Andrew Ratcliffe:111111:07777777777;Michael Burton :22222222: 07888888888;" RE: Program to print: Last Name, ID, Mobile Number, All - micseydel - Feb-24-2017 You need to post code in code tags and with the proper indentation. RE: Program to print: Last Name, ID, Mobile Number, All - panick1992 - Feb-24-2017 Is there any chance you could write some of the code and give me some guidance to write the rest of it>? I know i shouldn;t been asking this but I am desperate to solve this exercise RE: Program to print: Last Name, ID, Mobile Number, All - micseydel - Feb-24-2017 If you're really desperate, spend some time writing a proper question for your post and we'll become very helpful very quickly :) Really though, this forum is about education and education is effortful, so some struggle is expected. We do also have a tutorials section. |