jazzd
January 8, 2024, 4:34pm
1
I tried this literally over 100 different ways. Whoever created this didn’t write it specifically correct. I need the answer.
You can use the built-in function print()
to print the output of your code on the terminal. Functions are reusable code blocks that you can call (run) when you need them. To call a function, you just need to write a pair of parentheses next to its name. You will learn more about functions very soon. For now, print your text
variable to the screen by including the variable name between the opening and closing parentheses of the print()
function.
We aren’t allowed to write answers for people. Please post your current code and a link to the step so we can help you with your code. Thanks
jazzd
January 8, 2024, 4:51pm
3
I can’t re write 100 ways I did it. It begins with this
print(“Hello World”)
And I’ve put text in the parenthesis and tired this so many ways . The Step doesn’t make sense based on how simple it should be
Please post the link to the step
Edit: found it
Learn to Code — For Free
For now, print your text
variable to the screen by including the variable name between the opening and closing parentheses of the print()
function.
You aren’t printing what’s requested. You are asked to print text
Ogma
January 8, 2024, 5:00pm
5
If this challenge is Learn String Manipulation By Building a Cipher - Step 3
The beginning line is this,
text = ‘Hello World’
It doesn’t begin with,
print(“Hello World”)
The challenge is basically to pass the text string variable over to the print function, not print “Hello World” directly with the print function.
jazzd
January 8, 2024, 5:08pm
6
This is what printed on the terminal
text
It already printed text…?
No, you printed what you know is inside of text
instead of using the variable. You need to use the literal variable name text
Ogma
January 8, 2024, 5:14pm
8
A variable is like a box container for data. In this case that container is called text,
and contained inside text is the string data ‘Hello World’
The challenge is asking to pass the container over to the print function.
Again, the challenge begins by giving the container(text) and the string data within text ‘Hello World’
text = ‘Hello World’
All that needs to be done is to pass the container to the print function.
Some hints: This is the print function by itself. print()
Passing something means putting something between the parenthesis.
jazzd
January 8, 2024, 5:33pm
9
That’s not what I did
This is the instruction::
For now, print your text
variable to the screen by including the variable name between the opening and closing parentheses of the print()
function.
It said stick the variable name in the parenthesis of the print()…That’s exactly what I did…
jazzd:
print(“Hello World”)
This is not the variable name though. The variable name is text
, not "Hello World"
.
1 Like
Ogma
January 8, 2024, 5:36pm
11
Yes, that’s what I was trying to point out.
Yes, its what both of us have been saying
Ogma
January 8, 2024, 5:39pm
13
I never said it was ‘Hello World’.
Ah, I quoted the wrong line. My text still is accurate.
Edited - better now?
I quoted the wrong post. I fixed the quote above so its clearer that we’ve been saying literally the same thing to the OP.
jazzd
January 8, 2024, 6:12pm
17
I know it’s text. That’s what I did.
jazzd:
print(“Hello World”)
Right here you did not write text
jazzd
January 8, 2024, 6:34pm
19
I don’t know what you’re talking about. print(“Hello World”) is not the correct answer. Nor is print(“text”) the right answer
That’s closer to the answer, but you aren’t using the variable here. You don’t put ""s around a variable when you use it. The string "text"
isn’t the same thing as the variable text
.
1 Like