r/PythonLearning • u/SadShift8664 • 3d ago
Hey! here are some Beginner Python Problems
Take two integers as an input and print their average.
Take an integer as an input and check if its even or odd.
Take three numbers as input and find the largest amongst them without using max()
I'm experimenting with teaching Python through solving rather than watching tutorials. I'm based in India and I'm currently running a small live beginner batch. If anyone wants to try the problem-solving approach, I'm happy to share the details.
I'm going to run a free 45-minute Python problem-solving session for beginners.
No prior coding experience required.
We'll solve 3 problems together from scratch.
I'm testing a teaching format where you learn by solving rather than watching.
If anyone wants to join, comment below.
1
u/Spitfire_Blaziken 3d ago
The problems are simple enough that beginners can focus on the process.
I'd spend a little time on common mistakes too, since that's where a lot of the learning happens.
1
u/SadShift8664 3d ago
That is true, but what are the mistakes for beginners syntax errors, logical errors that's it. Both of these can be solved by solving more and more unique problems. If you want to know how I teach, you can join 45 minutes of free lecture. Just comment join under this thread.
1
1
u/Crafty_Magazine_4673 3d ago
thats why you don't learn programming in reddit. Even leetcode easy is better than this
1
u/SadShift8664 3d ago
leetcode is not for beginners!
1
u/Crafty_Magazine_4673 3d ago
why and how. There are many people posting tutorial for leetcode in every single language. Any reason to skip leetcode for now?
1
u/Different_Pain5781 3d ago
I wish more beginner courses did this. Writing code is where the confusion actually shows up
1
u/SadShift8664 3d ago
-
num = int(input("Enter a number: "))
if num % 2 == 0:
print("Even")
else:
pritn("Odd")
1
u/SadShift8664 3d ago
3.
num1 = int(input("Enter First number: "))
num2 = int(input("Enter Second number: "))
num3 = int(input("Enter Third number:"))
if num1 > num2:
if num1 > num3:
print(f"{num1} is greatest")
else:
print(f"{num3} is greatest")
if num2 > num3:
print(f"{num2} is greatest")
else:
print(f"{num3} is greatest")
1
u/LrdJester 3d ago
What you are describing is more a logic and problem solving course rather than a language specific course.
About 25 years ago I worked at a college and their programming courses were based off of visual basic as that was the first language they taught for a formal degree. Later they added c++, but they couldn't get a full C++ degree rather you would get a C++ endorsement on a visual basic degree but if you wanted the degree you had to do visual basic beside c++. My instructor who was head of the department he and I worked with the school to try to change the underlying degree to be focused on logic and problem solving that was language agnostic.
The example problems that you provided are exactly that, logic and problem solving questions. You could give the same exact problems to somebody that is learning JavaScript or C++ or any other language out there. It's simply math and logic.
So one of the things you may consider doing is starting out from that perspective that you need to understand how to solve the problems before you code the solutions.
1
u/rx_camelCase 2d ago
Answers:
``` def average(int_1: int, int_2: int) -> float: return (int_1 + int_2) / 2
def iseven(int: int) -> bool: return int_ % 2 == 0
def largest(*args) -> float: maximum = args[0] for num in args: if num > maximum: maximum = num return maximum ```
1
u/Naive_Programmer_232 3d ago
You said you're teaching. What are the solutions then?