there is a error some i get the message my code has not passed but cant find the error
# User Editable Region
String_1 = "I am a string"
String_2 = 'I am also a string '
String_3 = 'This is not valid'
# Deleting the 'number' variable (if it exists)
if 'number' in locals():
del number
# Declare a new variable called 'text'
text = "Hello, World!"
# Printing the values to verify
print(String_1)
print(String_2)
print(String_3)
print(text)
string_1 = "i am a string"
string_2 = 'I am also a string'
string_3 = 'This is not '
text= " hello world "
# User Editable Region
String_1 = "I am a string"
String_2 = 'I am also a string '
String_3 = 'This is not valid'
# Deleting the 'number' variable (if it exists)
if 'number' in locals():
del number
# Declare a new variable called 'text'
text = "Hello, World!"
# Printing the values to verify
print(String_1)
print(String_2)
print(String_3)
print(text)
string_1 = "i am a string"
string_2 = 'I am also a string'
string_3 = 'This is not '
text= " hello world "
# User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Challenge Information:
Learn String Manipulation by Building a Cipher - Step 2
Describe your issue in detail here.
i am getting an error message but not sure where my mistake is
Your code so far
text = “hello world”
string_1 = “I am a string”
string_2 = ‘I am also a string’
string_3 = ‘This is not valid’
# User Editable Region
text = "hello world"
string_1 = "I am a string"
string_2 = 'I am also a string'
string_3 = 'This is not valid'
# User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Challenge Information:
Learn String Manipulation by Building a Cipher - Step 2
The instructions: " Delete your number variable and its value. Then, declare another variable called text and assign the string Hello World to this variable."
Reset the step.
Delete the existing code line
Declare a new variable called ‘text’
Assign a string value “Hello World” to the ‘text’ variable.
It looks like you fixed the variables in the example. But the question asked you to make a variable called text and assign the string Hello World to this variable.
string_1 = "I am a string"
string_2 = 'I am also a string'
string_3 = 'this is not valid'
# declare a new variable called 'text' and assign the string "hello world"
text = "hello world"
This doesn’t have the same capatalisation as the question is asking. (Also make sure to keep the number variable, don’t remove what was already there.)
string_1 = "I am a string"
string_2 = 'I am also a string'
string_3 = 'this is not valid'
# declare a new variable called 'text' and assign the string "hello world"
text = "hello world"
I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.