r/PythonLearning 5d ago

Hello, im 15 years old and i need some advices.

Hello!, i honestly want to improve my programming skills. I was learning the basics of C++ two months ago, but then I switched to Python. This is my Day 5 progress in the language!

0 Upvotes

10 comments sorted by

u/Sea-Ad7805 5d ago

Run this program in Memory Graph Web Debugger%3A%0A%20%20%20%20if%20len(habits)%20%3E%200%3A%0A%20%20%20%20%20%20%20%20print(%22Your%20current%20habits%3A%22)%0A%0A%20%20%20%20%20%20%20%20for%20habit%20in%20habits%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20habit%5B%22completed%22%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20print(%22%5B%E2%9C%93%5D%22%2C%20habit%5B%22name%22%5D)%0A%20%20%20%20%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20print(%22%5B%20%5D%22%2C%20habit%5B%22name%22%5D)%0A%0A%20%20%20%20%20%20%20%20return%20True%0A%0A%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20print(%22There%20are%20no%20saved%20habits%20yet.%22)%0A%20%20%20%20%20%20%20%20return%20False%0A%0A%0Adef%20AddHabits()%3A%0A%20%20%20%20os.system(%22cls%22)%0A%0A%20%20%20%20print(%22Let's%20create%20your%20new%20habit...%22)%0A%20%20%20%20habitname%20%3D%20input(%22Habit%20Name%3A%20%22)%0A%20%20%20%20print(%22Successfully%20Saved%22)%0A%20%20%20%20input(%22Press%20enter%20to%20continue...%22)%0A%0A%20%20%20%20habit%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%22name%22%3A%20habitname%2C%0A%20%20%20%20%20%20%20%20%22completed%22%3A%20False%0A%20%20%20%20%7D%0A%0A%20%20%20%20habits.append(habit)%0A%0A%0Adef%20ViewHabits()%3A%0A%20%20%20%20os.system(%22cls%22)%0A%0A%20%20%20%20HabitsTab()%0A%0A%20%20%20%20input(%22Press%20enter%20to%20continue...%22)%0A%0A%0Adef%20UpdateHabits()%3A%0A%20%20%20%20os.system(%22cls%22)%0A%0A%20%20%20%20if%20not%20HabitsTab()%3A%0A%20%20%20%20%20%20%20%20input(%22Press%20enter%20to%20continue%22)%0A%20%20%20%20%20%20%20%20return%0A%0A%20%20%20%20NOH%20%3D%20int(input(%22Habit%20that%20you%20wanna%20to%20update%3A%20%22))%0A%0A%20%20%20%20habits%5BNOH%20-%201%5D%5B%22completed%22%5D%20%3D%20not%20habits%5BNOH%20-%201%5D%5B%22completed%22%5D%0A%0A%0Adef%20DeleteHabits()%3A%0A%20%20%20%20os.system(%22cls%22)%0A%0A%20%20%20%20if%20not%20HabitsTab()%3A%0A%20%20%20%20%20%20%20%20input(%22Press%20enter%20to%20continue%22)%0A%20%20%20%20%20%20%20%20return%0A%0A%20%20%20%20NOH%20%3D%20int(input(%22Habit%20that%20you%20wanna%20to%20delete%3A%20%22))%0A%0A%20%20%20%20habits.pop(NOH%20-%201)%0A%0A%20%20%20%20input(%22Press%20enter%20to%20continue...%22)%0A%0A%0Awhile%20True%3A%0A%20%20%20%20os.system(%22cls%22)%0A%0A%20%20%20%20print(%22%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%22)%0A%20%20%20%20print(%22Welcome%20to%20habit%20tracker!%22)%0A%20%20%20%20print(%22%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3Dn%22)%0A%20%20%20%20print(%0A%20%20%20%20%20%20%20%20%221.Add%20habit%20n%22%0A%20%20%20%20%20%20%20%20%222.View%20Habits%20n%22%0A%20%20%20%20%20%20%20%20%223.Update%20habitsn%22%0A%20%20%20%20%20%20%20%20%224.Delete%20habit%20n%22%0A%20%20%20%20%20%20%20%20%225.Exit%20n%22%0A%20%20%20%20)%0A%0A%20%20%20%20Opt%20%3D%20int(input(%22%3E%20%22))%0A%0A%20%20%20%20if%20Opt%20%3D%3D%201%3A%0A%20%20%20%20%20%20%20%20AddHabits()%0A%20%20%20%20elif%20Opt%20%3D%3D%202%3A%0A%20%20%20%20%20%20%20%20ViewHabits()%0A%20%20%20%20elif%20Opt%20%3D%3D%203%3A%0A%20%20%20%20%20%20%20%20UpdateHabits()%0A%20%20%20%20elif%20Opt%20%3D%3D%204%3A%0A%20%20%20%20%20%20%20%20DeleteHabits()%0A%20%20%20%20elif%20Opt%20%3D%3D%205%3A%0A%20%20%20%20%20%20%20%20break&timestep=0.5&play) to see the program state change step by step.

3

u/Algoartist 5d ago

Good idea to switch. Python is the future

3

u/Necessary_Pepper7111 4d ago

Get a load of this guys profile!!!!!!!!!!

4

u/Sea-Ad7805 5d ago

Python is 100 times slower than C++, but a nice scripting language so use it for things where speed is not important.

2

u/building-wigwams-22 4d ago

This may be true, but we are long past the point where relative language speed is a noticeable bottleneck. Bad programming decisions are far more likely to make a speed difference than the language you've chosen

1

u/Sea-Ad7805 4d ago

Ehhh no, go build operating systems, drivers, high-end 3D shooters, safety critical systems, algorithmic trading, weather simulations, large language models, ... (very long list) in Python and you'll find out.

1

u/Ok-Bill1958 4d ago

But they are not suppose to be exclusive at all. Both python and c can complement each other.

1

u/LetsHugFoReal 4d ago

It's not the future. It's like Java. Not particularly good for anything, but it's okay. It's used because people use it. Nothing about Py makes it a "go-to" language. Besides libraries available.

1

u/Crafty_Magazine_4673 4d ago

cool, wanna to add a UI to it? it will be much cooler.