AliRR
December 22, 2023, 4:18pm
1
Can someone please help me in Step 12 in python
text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz"
alphabet.find((text[0]), "a")
main.py
/* User Editable Region */
text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz"
alphabet.find((text[0]), "a")
/* 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 12
ilenia
December 22, 2023, 4:59pm
2
for some reasion you have changed one of the quotes of this string to a double quote, that would be one reasion for why it wouldnât work
second,
find
should only have one argument, and that should be the first letter of text
, you should not write "a"
there
AliRR
December 22, 2023, 6:08pm
3
can you please help me fix this code
text = âHello Worldâ
shift = 3
alphabet = âabcdefghijklmnopqrstuvwxyzâ
alphabet.find(âaâ):
text[0]
ilenia
December 22, 2023, 6:32pm
4
pass text[0]
to the function.
ilenia
December 22, 2023, 7:09pm
6
have you corrected your syntax error?
To pass something to a function means that you give it to the function as input, writing it between the round brackets used to call the function
AliRR
December 22, 2023, 7:54pm
7
can you tell me the code to pass
pls
ilenia
December 22, 2023, 7:55pm
8
no, I canât
if you need more help you can show us the code you have now
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.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').
AliRR
December 22, 2023, 7:56pm
9
text = 'Hello World'
shift = 3
alphabet = "abcdefghijklmnopqrstuvwxyz"
alphabet.find():
text[0]
You did not put the text[0]
inside of the call to find()
a_string.find(char)
ilenia
December 22, 2023, 8:00pm
11
you also have not formatted your code, I have formatted the code for you, please format your code
AliRR
December 22, 2023, 8:04pm
12
yea screw this
thanks for âhelpingâ me
1 Like
Iâm happy to help more if you can tell me more about what has you confused. But we cannot write answers for users.
Your code needs to look almost identical to the example given, but with different things in place of a_string
and char
.
AliRR
December 22, 2023, 8:07pm
14
can u plss tell me what to type in those
We cannot write the code for you.
At the end of your code, call find()
on your alphabet
string and pass text[0]
to the function.
These are the three things the instructions tell you to use.
AliRR
December 22, 2023, 8:10pm
16
like alphabet.fint(text[0])?
ilenia
December 22, 2023, 8:10pm
17
you need to use the find
function with alphabet
and text[0]
ilenia
December 22, 2023, 8:10pm
18
why donât you try this code?
AliRR
December 22, 2023, 8:10pm
19
text = 'Hello World'
shift = 3
alphabet = "abcdefghijklmnopqrstuvwxyz"
alphabet.find(text[0]):
Where did the : come from?