|
Is it possible to solve this question without using any if statement or any other built-in Python function? Thanks |
|
Why do you guys post the answer here???!! Do you gain extra credits/points for it? Really angry ... 1
Are you responsible on how people learn? Obviously, many community members are having problems with this question. The problems vary from knowing a little math (adding the right number) to python programming. The community consists of many types of users... noobies being one. They come here for help. Tips, spoilers, or whatever... its the users choice, and Udacity's choice to remove Tips, spoliers, or whatever. People learn differently. There is no monopoloy on how people should 'REALLY' learn. @Fuzzmz, ... and Udacity will take care of delineating where the line is drawn. It appears that 'content' and 'solutions' vary in definintion as this thread shows. At the risk of repeating myself, "it can be done" is not a helpful answer when someone is stuck. If we weren't supposed to discuss useful approaches to problems, these forums wouldn't be all that useful. 1
But to quote from a reply @PeterUdacity made when I commented that I wasn't sure how much help was appropriate: "Try to do your best to clarify the problem, but avoid talking about how you would answer it. I know this is vague. I'll talk it over with Professor Evans later." Also, keep in mind that they have said in multiple places with respect to the last homework question that they do not expect us all to be able to do it. They will post an answer and explanation, and we can all discuss and re-explain all we want, once the deadline has passed. I know it's a really hard line to draw, and very frustrating not to be able to help. But I think a lot of the discussion of this problem has gone well beyond the "clarify the problem" and into the "how you would answer it" territory. (as an aside, and a defense of @cbandarrinha, when this answer was first posted there were a couple links, including one in this thread, to an actual solution hosted at pastebin. They've since been removed. But that seemed clearly over the line.) edit to add: from my perspective, when I was stuck because I was convinced that I needed either conditionals or int(), posts that said "it's possible to do it without either of those things" were an absolutely perfect hint. They reassured me that continuing to think about it wasn't a total waste of effort, but still forced me to come up with the solution on my own. And with several days before the homework is due! @Lisa... A user makes an active choice to 'click' on a link which they know they can get the answer. If you are a student that has already solved the problem then it's good to compare your answers with others. If you are a student that is stuck, doesn't care or is fed up of waiting, the choice to click on the link is still yours and you'll learn something (hopefully). This is a very vague/grey area as @PeterUdacity has pointed out. If they define the rules to strictly they would have to police the site constantly looking 'rule violators'. If they define the rules to vaguely... well that's why we're here. Some of us think that some users are sharing too much information and others are grateful for the posts. We all approach and solve problems very differently. @Lisa has great self-motivation to continue moving on and pushing forward after being reassured... others don't have that or haven't developed it yet. Either way I think what @Avrila Klaus has done is more beneficial than delimiting. If many feel that these types of posts are sharing 'too' much information then perhaps a special tag that is announced with the question that states: 'Some users feel that TOO much information is being shared about solving the problem in this thread... Enter at your own Learn-isk'. The announcement would deter those self-motivated users who do not want too much information in solving the problem (active choice). The announcement would also bring in those users having the most difficulty. The choice is and always will be yours. |
|
Hi everybody! ;) It's so simple! I took about 2 hours thinking how to solve this without using "if" or any extra functionality we didn't learn from Unit 1, but finally got the answer. HINT: Don't think big. Numbers are composed by numbers, just that simple! ;-) |
|
Its awesome problem. I am happy to invest my time for solving this problem. No string found really helps. |
|
Very easy, hint: convert from number to string, and get the position 0. Good luck 1
What about if the number has more than one digit? Example: x = 2367.1466789. Then position 0 only gets "2" 2
@GorkaMM: I used find to get the location of the decimal point and assigned it to decimal, and then used [:decimal] to get everything before it. what about rounding up if required also? @avrila-klaus Yeah, that's the way it should be done! I was just trying @nguyen-kha-chuong to see that way isn't the best. @djoldskool This is just a part of the whole process. You must do some more stuff to get it to work ;-) @Nguyen Kha |
Solved thinking a little. Thanks