I'm a very, very n00b developper learning Python at university (I started a few weeks ago really) and I'm on my first assignment. Everything's going well, except one thing and i just can't figure it out. Or rather, I know what the problem is, but I can't find the solution. In short, I need to ask the user to input a number, and if number is 0, then the programs shows a message and stops there. Otherwise, it goes on with asking more info and uses For loops. My question is: How do I insert lines that are not part of the IF (user has entered 0) but also not part of any For loops (i don't want these lines repeated). I'm not sure if that makes any sense.
basically i want the last print to be shown if the user has entered more than 0 in the beginning, but not be shown if the user has entered 0. I'm not showing the actual code, since it's a uni assignment, but the screenshot shows exactly the issue I'm having with the real code :) Thanks for your help!! (also, sorry that it's actually a link, because i don't have enough points yet to embed the image).
Aucun commentaire:
Enregistrer un commentaire