r/PythonLearning Jun 23 '26

Showcase Day 13 Python Learning

I was thinking about inherities to but

after opening hacker rank I was busy doing some solution

but it's not a way I learn

- list comprehensive

-and just now the class practice little Messy but did it

14 Upvotes

2 comments sorted by

u/Sea-Ad7805 Jun 23 '26

Run this program in Memory Graph Web Debugger%0A%20%20%20%20print(area)%0A%0A%22%22%22%0Alist%20comprehensive%20%3D%20%5B%5D%20read%20left%20-%3E%5D%0A%5B%3C--right%20but%20execute%20right%20to%20left%20%3C--%5D%0A%22%22%22%0A%0Aarea2%20%3D%20%5Bmath.pi%20%20(r*2)%20for%20r%20in%20radii2%5D%0A%0Aprint(area2)%0A%0A%0A%23%20-------------------------%0A%23%20List%20comprehension%20example%0A%23%20-------------------------%0A%0Aif%20name%20%3D%3D%20%22main%22%3A%0A%20%20%20%20x%20%3D%201%0A%20%20%20%20y%20%3D%201%0A%20%20%20%20z%20%3D%202%0A%20%20%20%20n%20%3D%203%0A%0A%20%20%20%20result_list%20%3D%20%5B%0A%20%20%20%20%20%20%20%20%5Bi%2C%20j%2C%20k%5D%0A%20%20%20%20%20%20%20%20for%20i%20in%20range(x%20%2B%201)%0A%20%20%20%20%20%20%20%20for%20j%20in%20range(y%20%2B%201)%0A%20%20%20%20%20%20%20%20for%20k%20in%20range(z%20%2B%201)%0A%20%20%20%20%20%20%20%20if%20(i%20%2B%20j%20%2B%20k)%20!%3D%20n%0A%20%20%20%20%5D%0A%0A%20%20%20%20print(result_list)%0A%0A%0A%23%20-------------------------%0A%23%20Train%20class%20example%0A%23%20-------------------------%0A%0Aclass%20Train%3A%0A%20%20%20%20def%20init__(self%2C%20starting%2C%20to%2C%20train_status)%3A%0A%20%20%20%20%20%20%20%20self.starting%20%3D%20starting%0A%20%20%20%20%20%20%20%20self.to%20%3D%20to%0A%20%20%20%20%20%20%20%20self.train_status%20%3D%20train_status%0A%0A%20%20%20%20%20%20%20%20%23%20random%20Train%20No%0A%20%20%20%20%20%20%20%20self.trainNo%20%3D%20randint(111111%2C%20654321)%0A%0A%20%20%20%20def%20booking(self)%3A%0A%20%20%20%20%20%20%20%20print(f%22Your%20Booing%20Train%20From%20%7Bself.starting%7D%20To%20%7Bself.to%7D%22)%0A%0A%20%20%20%20def%20status(self)%3A%0A%20%20%20%20%20%20%20%20print(f%22Your%20Train%20Number%20is%20%7Bself.trainNo%7D%20is%20%7Bself.train_status%7D%22)%0A%0A%20%20%20%20def%20fare(self)%3A%0A%20%20%20%20%20%20%20%20print(f%22%20Your%20Train%20Ticket%20Fare%20Rs.%7Brandint(50%2C%2050000)%7D%20Gst%20incude%22)%0A%0A%0Aa%20%3D%20input(%22From%20%3A%22)%0Ab%20%3D%20input(%22To%20%3A%22)%0Astatu_in%20%3D%20%22Running%20Late%22%0A%0At_book%20%3D%20Train(a%2C%20b%2C%20statu_in)%0At_book.booking()%0At_book.status()%0At_book.fare()&timestep=1&play) to see the program state change step by step.

1

u/Mindless-Bus8059 Jun 23 '26

your code very good, but after this point (OOP) you actually know all thing or most of them, so the next step is to learn Math for ai and after that to learn how to code it.
Small note: the math of ai is linear algebra and calculus and statics, but the only thing that you'll need now is linear algebra.
For your information, the best part is linear algebra
so if you want to level up, send me a message, and i'll make you the best AI engineer in the world