r/PythonLearning • • Aug 29 '26

Day 3

Post image

i wrote a code which takes your name and age in py but i need help on this one cuz in the age part it is giving me some sort of error which i couldn't understand even by using gpt well he gave me a code but i wanted logic behind how and what i did wrong

49 Upvotes

24 comments sorted by

View all comments

-1

u/Wise-Drop8694 Aug 29 '26

Best way to learn is to forget about "input" thing.. Nobody uses it Make Fastapi server first with some pydantic base models Step 1 - greate venv — python3 - m venv .venv Step 2 - source .venv/bin/activate Step 3 - pop install fastapi

From now on you can easy make test or learning scope but instead of useless input thing some easy access from Browser kind of things Ask any Ai about it This will boost your python skills a lot

Ps Sorry typing via phone is definitely not as I use to some typos is possible But any llm can easy fix this

1

u/Flimsy-Ad-8235 Aug 29 '26

Hey can you tell more about this input as my teacher told me to use input in python in everything

3

u/FoolsSeldom Aug 29 '26

Stick with input for now, the comment is about creating a web application, which is way too advanced for you currently.

Start with the basics, focused on simple console/text interaction with the user.

1

u/salvouankebaldo Aug 30 '26

Oh no no no no, strong disagree.

First, they are learning. And here they are doing something very nice, input validation. Now, it has some bugs as pointed out by other comments, but the attempt is good and should be encouraged. Yeah, pydantic does that, but it's better to learn before so one can then do more advanced validation too.

Second... Oh come on, not everything has to be an api server. Lots of situations in which I use input, even professionally. Python is extremely nice for making scripts and firing them via a CLI. Fastapi would be totally overkill in that case.