Help With Python

Alphabetize

Nastyblood
8 years ago | edited 8 years ago

0

I’m facing many problems.
First of all , i’m willing to copy paste it , until i learn the selenium and mechasomething modules so i can automatically pass the level.

So far i got to this code :
No you aint getting spoilers here

First Problem :
The variables . I found the STRINGNAME.split(‘seperator’) command on a post and couldn’t find the whole explenation of the command.
I want to set a list of variables equal to the lengh of the words after the split . But i cant split until i know the lengh of the words so i can put an according number of variables . Anyone got any idea?

Second Poblem :
After giving as an input to the program a number of words = to the lengh of the list alphabet , cause it wont work otherwise thats what happened:
Input : did, may, our, from, not, your, had, she, got, yet, own, rather, after, while, able, their, was, with, most
Output : [‘able’, ‘after’, ‘did’, ‘from’, ‘got’, ‘had’, ‘may’, ‘most’, ‘not’, ‘our’, ‘own’, ‘rather’, ‘she’, ‘their’, ‘was’, ‘while’, ‘with’, ‘yet’, ‘your’]
Is there a way i can remove the ‘ ’ ‘ ’ from the output ? If i store it as 1 big string , i wont be able to sort it , and if i split the stirng im getting such output . I’m totally lost

13replies
5voices
278views
? [bolofecal]
8 years ago

0

The problem:

a, b = [1, 2, 3]

more values than variables.

To print a array I sugest join first:

'<something>'.join(words)

Your post have a piece of solution, maybe it can be a spoiler.

Nastyblood
8 years ago

0

To be honest i still dont understand how i’ll do it after i join . Anw want me to put my code as a spoiler or just remove it ?
Cause unless you make python automatically copy and post the words there no way you’re gonna hvve time to copy and paste it in time

? [bolofecal]
8 years ago | edited 8 years ago

0

```>>> url = [‘hackthis’, ‘co’, ****‘uk’]

print url
[‘hackthis’, ‘co’, ‘uk’]
print ‘.’.join(url)
hackthis.co.****uk```

Nastyblood
8 years ago

0

Nevermind i got a way to make the code , all i need still is the speed , i figured out a module in python that will copy the answer directly for me , but cause my internet is too slow i wont be able to make it in the 5 seconds :P
Imma try a few more times if it doesnt work ill try the Selenium module

? [bolofecal]
8 years ago

0

I think the easy way is javascript.

Nastyblood
8 years ago

0

I dont know javascript and i’m planning on learning python for now soo i really wanna pass this using python :P
My answer is always expiring before like 0.1 second :

cn9 [1337boy]
8 years ago

0

i solved it with the requests module for python

Nastyblood
8 years ago

0

1337 ill pm you the code i’m using :P I’m always missing at 0.5- 0.1 second :P

? [bolofecal]
8 years ago

0

So you can try mekr your python script login in hackthis and get the words without human interact.

Nastyblood
8 years ago

0

bolofecal i was trying to do it manually first .
My exams are next week soo i’ll probably pass this in 2 weeks using a request module for python

dloser
8 years ago

0

Yeah, better not post code. Even if it doesn’t work, it may contain spoilers for others.

You might want too look at https://docs.python.org/ as it has pretty extensive information on all the standard functionality and libraries. Alternatively, you can just do help(thing) on the interactive prompt (e.g. help(str.split) or help(‘bleh’.split)).

Nastyblood
8 years ago

0

Alright i removed the code .
Anw i rewrote a totally new code that is much better and that instantly copies the answer to clipboard , but still cause of my internet i can’t make it on time .
I’ll later check how to use the Selenium module and pass this level automatically

cn9 [1337boy]
8 years ago

0

requests module is better i think than selenium if you have to submit the data

2 replies have been removed
You must be logged in to reply to this discussion. Login
1 of 14

This site only uses cookies that are essential for the functionality of this website. Cookies are not used for tracking or marketing purposes.

By using our site, you acknowledge that you have read and understand our Privacy Policy, and Terms of Service.

Dismiss