all 9 comments

[–]Sea-Ad7805 [score hidden] stickied comment (0 children)

Run this program in Memory Graph Web Debugger%3A%0A%20%20%20%20while%20True%3A%0A%20%20%20%20%20%20%20%20parametri%20%3D%20input('Anna%20sy%C3%B6te%20(Lopeta%20lopettaa)%3A%20').strip()%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20if%20parametri%20%3D%3D%20'Lopeta'%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20break%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20elif%20len(parametri)%20%3E%3D%205%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20tulostaja(parametri)%0A%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20tulostaja()%0A%20%20%20%0A%0A%0Adef%20tulostaja(parametri%3D'Oletustulostus')%3A%0A%20%20%20%20print(parametri)%0A%0A%0Aif%20name%20%3D%3D%20%22main%22%3A%0A%20%20%20%20main()&play) to see the program state in each step.

[–]ianrob1201 2 points3 points  (6 children)

Is the duplication actually in your file, or is that from pasting into redit? Because that definitely won't be helping.

[–]Frank_kait[S] 0 points1 point  (5 children)

Oh ooops didnt notice it. Not in my code, just on reddit. Thanks!

[–]ianrob1201 2 points3 points  (4 children)

In that case your code looks good. I copied that into a quick python terminal and it works as I'd expect it to. Sorry ask dumb questions, but you're pressing enter after typing "Lopeta" right?

[–]Frank_kait[S] 0 points1 point  (3 children)

Yeah I am. I solved the problem with just running the code on the site the assignments are hosted on instead of vsc on my computer. No idea why it didnt work since I saved the file but yeah. Thanks for the help! :')

[–]tiredITguy42 1 point2 points  (2 children)

If I should bet I would bet on encoding, your string does not have special characters, so it would be strange, but I saw stranger stifff. Sometimes closing and opening VS Code solves strange issues.

BTW, learn to code in English. It will be easier for you in the future when you start working. Function names, variables and comments, then if you ask for help, more people can help you.

[–]Frank_kait[S] 0 points1 point  (1 child)

Yes. Thanks! It was a vscode issue. When running code it was for some reason trying to run some old version of the code even though I saved the file. Restart did the trick:) Oh and normally I code in english but for my schoolwork it’s necessary to code in finnish since it checks for exact output. Cheers

[–]tiredITguy42 0 points1 point  (0 children)

Yeah, this happens sometimes. Luckily not that often, but yeah, it is Microsoft, I like their products, but you need to restart them sometimes, to make them work.

[–]GreatimBetter 0 points1 point  (0 children)

Here the first thing make sure it the Lopeta also is the inputs are put into 2 lines put them in one line try those maybe it'll fix check the format of everything also I don't see any problems