Problems with print statment [closed] - python

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I am 100% new to programming and I'm having trouble practising the print hello world statement. My code is as follows:
print(hello world!)

You are missing the '' or "" that need to wrap around any string object in Python
Try:
print('Hello World!')
You may find this documentation useful.

Related

Why am I getting "invalid syntax. Perhaps you forgot a comma?"? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 months ago.
Improve this question
This happens almost every time I type print("something here"): it puts this error message box (and yes I've tried quotation marks instead of quote marks).
Currently you have
print('hello' +inp 'how is your day?')
You might want to place another + sign on the other end of your input variable.
print('hello' +inp+ 'how is your day?')

The print statement I use is showing a syntax error, kindly note the error on my code [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
Kindly look at 10th line of this code snippet:
You forgot to close print():
print(txt.read())

What does "\" mean in the following code? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I encountered this code while studying String Formatting Operators in Python:
print('%(language)s has %(number)03d quote types.'%\
{"language":"Python", "number":2})
What does "\" represent in this code?
As you can read in Python's documentation a back slash breaks the line of code allowing for the next line continuation.

Codeacademy - SyntaxError: 'return' outside function [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
I'm not sure why I'm getting this error.enter image description here
You only need a return statement if you are inside a function. The syntax of a function is the following:
def functionName():
# code goes here
return # you can also specify what to return here or just leave it
# blank, a return statement is not necessary.

Python process thread start and stop timer [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 9 years ago.
Improve this question
I'm having problems with my code and I'm not sure why python is not calling my function.
Here is the code I have. I only get Done to print out vice the print statements in startProcess
def startProcess(self):
print("hello")
def repeat(self):
self.startProcess
print("Done")
You are not actually calling self.startProcess, or is it a typo?
Try:
self.startProcess()

Categories

Resources