|
| 06 Oct 2016 08:38 PM |
if u have python knowledge I need help
username = input("Hey, What's your name?")
i = 0 for i in range(0, len(username)-1, 2): print(username[i + 1] + username[i])
so lets say your say your name is
Jack
itll output
aj kc
like the second letter then first new line 4th then 3rd. |
|
|
| Report Abuse |
|
|
| |
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 06 Oct 2016 08:43 PM |
username = "Jack" s[::-1]
Now that it's reversed all you need to do is get the first two and last two letters with string.find. |
|
|
| Report Abuse |
|
|
Kutoru
|
  |
| Joined: 22 May 2016 |
| Total Posts: 288 |
|
|
| 06 Oct 2016 08:44 PM |
| Dude you seriously need to start learning stuff yourself |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 06 Oct 2016 08:46 PM |
Better yet:
Username = "Jack"[::-1] |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 06 Oct 2016 08:47 PM |
| You need to learn how to do stuff in steps then you can create the function that'll do it in the steps that are in the most logical order. |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2016 08:49 PM |
Dev, What if the name isn't Jack and it's Jackie.
6 letters. I want it to work with any name.
|
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 06 Oct 2016 08:49 PM |
| And to find the half of each word just do word len/2 and or modulus so it'll return the end parts in case it's an uneven word. |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2016 08:52 PM |
Dev, I am still learning python and almost completely clueless.
I literally know more LUA than Python,
and you know my LUA knowledge is mediocre.
:L
|
|
|
| Report Abuse |
|
|
|
| 06 Oct 2016 08:54 PM |
| I am just so confused on where to start honestly. |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 06 Oct 2016 08:57 PM |
| What we are doing isn't syntax based it's common sense for all coding languages. |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2016 09:00 PM |
| did I mention how dumb I am |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 06 Oct 2016 09:02 PM |
No need to, I can see that by what you're asking and saying.
Step 1: Reverse string. Step 2: split string in half and account for uneven strings as you can't cut a letter in half. Step3: decide where to put the extra letter. (On what output.)
And that should be done... |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 06 Oct 2016 09:03 PM |
| I'd do something along the lines of len/2 and using modulus for getting the remainder. |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2016 09:07 PM |
welp now im confused cause the play button is grayed out, I got a python console open for testing but I can't test cuz the play buttong rayed out
any ideas |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2016 09:11 PM |
forget that Illl use the other console.
So the code I got now,
If I type gray in for the input
it does rg --- good
then ay but I wanted ya
and I have no clue |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 06 Oct 2016 09:15 PM |
| ################################################################################################################################################################################################################################## |
|
|
| Report Abuse |
|
|
DevVince
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 9245 |
|
|
| 06 Oct 2016 09:17 PM |
| Welp I tried to give you the answer in lua but it censored it. Anyways I pretty much told you how. AND STOP SENDING ME MESSAGES OR I'LL BLOCK YOU. |
|
|
| Report Abuse |
|
|
|
| 06 Oct 2016 10:21 PM |
| I mean u can reply to a message, i thought u were a nice person and i helped u witha trade wowowow |
|
|
| Report Abuse |
|
|