Noob want a help

hello gays, im not god at english and im new here
anyone can help me fix this bug?


import os

def os {
    printf("my cpu count is"+os.cpu_count());
}

Are you sure it is a Python code? Because it doesn’t look like… :confused:

it not a Python code? im not sure

it throws a syntax-error··········

It is not. Where you got that code?

my dad wrote it in a book and the name of the book is The magic

can you show me the valid code?

Well for the start:

  • Python doesn’t use {} blocks at all. It uses indentation,
  • there is no printf(...) function in the language

I’m not sure what the code is supposed to do. Can you write it in English sentences? (e.g. what you want it should do)

Ok,i want to count my central process unit and show it

Then this should do:

import os

def count_cpus():
     print(f"My cpu count is {os.cpu_count()})

and could you please tell me where is the entrypoint of the python code?

Ok,thank you
you r a good guy

There is no “entry point” in Python. A python program starts with the beginning of the file and executes everything to the end.

Thank you again. You 've been a great help.