I'm a total beginner and I'm trying to get my first piece of code running, but it seems like I'm missing something. Here's the code I've written:
```
main( ) {
print("hello, worldn");
}
```
I'm using Python in PyCharm Community, and I thought I was hitting the right run button (the little bug up top). But nothing happens when I try to run it. Any ideas on what I'm doing wrong?
2 Answers
You're on the right track, but it looks like you're using syntax from another programming language, likely C. In Python, we don't use curly braces. Your function should start with `def`. Here's how your code should look:
```python
def main():
print("hello, world")
```
You can just call `main()` after that to run it. Double-check that, and it should work!
Definitely check out the differences in syntax for Python. Your code snippet resembles C syntax too closely. In Python, you would define a function with `def`, and indentation is important! Just a tip: make sure you're using the correct syntax for the language.
Oh, what should I use for Python then?