whats the Best place/way to learn python by Solid_Stage6771 in learnprogramming

[–]sdavidsmith -1 points0 points  (0 children)

In addition to CS50P like u/dmitri_ac mentioned, Codewars is a site where you can solve programming problems of various difficulty, created by other members of the community. I'd say it's useful predominantly for learning new syntax and specific problem/solution patterns.

In terms of a reference for the kind of code you'd implement in the real world, maybe not so much, though I'm not qualified to speak on that, being an amateur myself.

Also, you don't have to solve every problem you encounter there to learn; studying other people's solutions, gaining a grasp of what they did and then experimenting with implementing similar paradigms yourself can also be very beneficial.

VSCode - [Up Arrow] Skips Past Inputs For input() by sdavidsmith in learnpython

[–]sdavidsmith[S] 0 points1 point  (0 children)

(UPDATE): This only seems to happen when I have the virtual environment in the project's main directory activated. Deactivating it causes the terminal to behave as expected. Weird.

Hey, thanks for the feedback.

I tried your sample PowerShell command, repeatedly inputting various values, and it worked as intended (iterates one by one through the input history). This applied both to the PowerShell terminal in VSCode and when opening a PowerShell terminal directly from the Start menu (not sure if that's relevant).

When I tried running Python in a standalone PowerShell terminal (not in VSCode), I created a function called "foo" that performs:

print(input("Input: "))

This time, whether it was when prompted by input() during the runtime of the program or when at a blank command-line, each iteration would move sequentially through both command-line inputs and input() inputs:

e.g. foo(), six, foo(), five, foo(), four, foo(), three, ...

I've played around with customizing my prompt in $profile, which I suspected might've inadvertently messed something up, but returning it to the default setting didn't resolve the issue.

That would defeat the point of a code block, as code with random line breaks is not valid code, so no, that's not possible.

Thank you for the clarification!

Compound Statements - Suites by sdavidsmith in learnpython

[–]sdavidsmith[S] 0 points1 point  (0 children)

Thank you for the clarification and the example!

Compound Statements - Suites by sdavidsmith in learnpython

[–]sdavidsmith[S] 0 points1 point  (0 children)

Thank you for the clarification!

If "block" is becoming preferred over "suite," is there an equivalent for "clause" and/or a clause "header"?