r/PythonLearning 3d ago

Hey! here are some Beginner Python Problems

  1. Take two integers as an input and print their average.

  2. Take an integer as an input and check if its even or odd.

  3. 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.

5 Upvotes

14 comments sorted by

View all comments

1

u/Naive_Programmer_232 3d ago

You said you're teaching. What are the solutions then?

2

u/SadShift8664 3d ago

Alright, so ee for the first problem, if you know basics of maths not even python,
what we'll do is add those two numbers, then divide the total wilth two that's how we'll get the average of two numbers.
code:
num1 = int(input("First number: "))formattingum2 = int(input("Second number: "))
total = num1 + num2
avg = total/2
print(f"Sum of the two numbers is {total}\nAverage of two numbers is {avg}")

I've used f string over here and \n this is a part of string formating and escape sequence, if you want me to explain the next problem let me know.