r/learnpython • • Oct 20 '26

My first go at Python

So I have been learning Python for around 4 hours and I just finished this and I would want to know if it's good or if it's just okay.

again = "yes"

while again == "yes":

print("create your character: ")

# sex

sex = input("sex? ").strip().lower()

while sex not in ['male', 'female']:

sex = input("try again, you misspelled male or female: ").strip().lower()

if sex == "male":

print("hello boyyy")

else:

print("helloooo girl")

# age

age = int(input("what is your age: "))

while age < 18:

age = int(input("try again "))

# name

name = input("what is your name: ").lower().strip()

print("hello " + name)

# height

height = int(input("height in cm "))

if height >= 180:

print("tall person eh?")

else:

print("nice.")

print("next questions")

# build

build = input("what is your build. skinny. fat. muscular. ").lower().strip()

while build not in ['skinny', 'muscular', 'fat']:

build = input("try again. that was not an option ").lower().strip()

if build == "skinny":

print("interesting choice... " + name)

elif build == "muscular":

print("perfect choice especially for a man")

elif build == "fat":

print("HAHAHA FATSO HAHAHA")

# stats

print('____')

print(' ')

print('stats for: ' + name)

print('age:', age)

print('height:', height)

print('sex:', sex)

print('build:', build)

print('____')

again = input("create another character? Yes/No: ").strip().lower()

while again not in ['yes', 'no']:

again = input("answer using Yes or No: ").strip().lower()

print("Goodbye!")

0 Upvotes

31 comments sorted by

3

u/LongLiveTheDiego Oct 20 '26
  1. Run it yourself and decide whether it works. If it works and you understand the code you wrote, it's good. Don't ask for validation if you can validate it yourself.

  2. Use Reddit markup, specifically backticks ``` to format your code because regular text doesn't include the text indentation, which is crucial in Python code.

1

u/ceej13_ Oct 20 '26

I see. Yes I have tested it. It works gladly and I also appreciate the ``` thing I never actually knew since this is my first post in a Python community

1

u/LongLiveTheDiego Oct 20 '26

In that case well done, good luck and welcome!

1

u/ceej13_ Oct 20 '26

Thanks for your wisdom

2

u/igotshadowbaned Oct 20 '26

Indenting is important in python and you've not provided that

1

u/ceej13_ Oct 20 '26

It pasted weird

1

u/HouseOfWyrd Oct 20 '26

Why is your main concern whether it's good or not?

That's incredibly contextual. What are you actually asking?

1

u/ceej13_ Oct 20 '26

Yeah just wether it's good or bad for my ammount of time spent with python

1

u/HouseOfWyrd Oct 20 '26

You're just repeating the same question.

It's a bunch of ifs and lists. It's not really anything.

Worry less about seeking validation from the internet after half a day's work and keep learning instead.

-2

u/ceej13_ Oct 20 '26

Okay boomer

1

u/gabs_at_searchapi Oct 20 '26

Nice to see someone learning from scratch. Keep going :)

1

u/ceej13_ Oct 20 '26

Thanks dude

1

u/LayotFctor Oct 20 '26

It's only been 4 hours. Yes, it's good for 4 hours of study, but there are still lots of features and techniques you haven't learned yet.

You've barely scratched the surface.Β Don't stop now, keep going.

1

u/ceej13_ Oct 20 '26

Thank you I'm starting young because I want to br a software engineer i have been wanting to for a few months now

1

u/Famous_Fly_8001 Oct 21 '26

for your first script i think this is insane well done bro

1

u/ceej13_ Oct 21 '26

Thank man I really appreciate it all love bro

5

u/[deleted] Oct 20 '26

[removed] β€” view removed comment

-1

u/ceej13_ Oct 20 '26

Very sorry

0

u/[deleted] Oct 20 '26

[removed] β€” view removed comment

0

u/ceej13_ Oct 20 '26

I don't know how to do code block 😭

1

u/Dazzling_Music_2411 Oct 20 '26 edited Oct 20 '26

"Select All" your text and then pick the code block option from your font icon (Aa).

PS. It's the one that has </> on the top left of a square, it should say "code block" when you hover over it.

1

u/ceej13_ Oct 20 '26

and why can't I edit this post i just made

0

u/[deleted] Oct 20 '26

[removed] β€” view removed comment

1

u/ceej13_ Oct 20 '26

Nvm absolutely nothing happens when I do back ticks and there is 0 code option I've tried for like 20 mins lol

-1

u/[deleted] Oct 20 '26

[removed] β€” view removed comment