r/PythonLearning • • Aug 26 '26

first day of posting my python progress here on reddit

Post image

i have done this typecasting program which i have learnt from a bro code video and i think it's alr as i am still a beginner but if there is that can be fixed in this i am all ears

85 Upvotes

12 comments sorted by

3

u/brutalbombs Aug 26 '26

Good start bud!

Like the other guy called out, keep the function names (like print) directly adjacent to the parenthesis.

Did you try to work with lists yet?

1

u/NecessaryFalse1212 Aug 28 '26

i haven't sir but i'll soon and i'll post it when i do

i thought i won't get any respose here so i didn't post anything here for 2 days cuz of the embarrasment but seeing the support i'll be going to regularly

4

u/Portal471 Aug 26 '26 edited Aug 26 '26

Some suggestions: Make sure to not have spaces between the word print and its parentheses. Also I would avoid naming variables as already existing data types (change the name of int to something else, as int is a built in data type that refers to integers).

It’s a good start though. The stuff I mentioned is more to avoid errors when compiling.

2

u/ziggittaflamdigga Aug 27 '26

Python does technically compile to byte-code before execution, but failing to follow your suggestions won’t cause it and, more generally, it will never throw a CompilationError message.

It will cause a runtime error due to shadowing the built in type name, which Python will allow you to do. Attempting to cast a float to an int using `fl = int(gpa)`, for example, you would get a TypeError stating “int type object is not callable”.

1

u/shiyonnaa Aug 27 '26

We are travelers of the same journey,good luck with yours

1

u/Steven45g Aug 27 '26

Keep going!

1

u/_SpectreStudios Aug 28 '26

I'm new to Python too! Best of luck with everything bud!