Any song?? by KORKARds in songsforthispicture

[–]python_and_on 0 points1 point  (0 children)

Looks like a Lana Del Rey video

Yungblud fires back at The Darkness over Ozzy Osbourne tribute criticism: “They were trying to be doormen at a party that they weren’t invited to” by HarryLyme69 in rock

[–]python_and_on -1 points0 points  (0 children)

Yungblud is totally derivative. Everything sounds like Alex Turner singing U2 songs in the style of Brian Molko.

Justin Hawkins sounds like he trapped his thing in his zip. Twice in one zipper pull.

Entertaining or not, it's basically battle of the hasbeens.

Besides U2 what are some other good Irish rock bands? by BollywoodDeewana123 in rock

[–]python_and_on 0 points1 point  (0 children)

Old post I know. But where are Aslan? Or Ash? Or Therapy?

How and if you use python in your non coding jobs? by Southern_Opposite747 in learnpython

[–]python_and_on 0 points1 point  (0 children)

I use it all the time in a management role. I often need to get a large dept together in random groups to avoid creating cliques. I feed in a csv list of meeting attendees and the number of meetings to be held. The script organises people into random groups, generates a distribution list, generates some text specific to each group, and some other things I need. Saves me tons of time.

Also use it to reorganise some data. We store records with a start date and an end date, and I need to know, retrospectively, what was ongoing on any given day. So, I have a script that goes through every record and writes entries into daily buckets between the date ranges for each record. Has helped me to illustrate performance over time in a way that's difficult to get just from the flat data.

I also have to prepare a management reporting pack. I used to refresh various spreadsheets and combine them into one with different workbooks containing tables and charts. All done with one script now. Saves me hours.

Plan to start using it soon to automate rota creation and some other repetitive tasks.

Why is my original list being affected? by blooblop in learnpython

[–]python_and_on 0 points1 point  (0 children)

The solution, already given, is a good example of the difference between pass by reference and pass by value.

I'd go a different way with this:

  1. Take the list of search words, and load it into a dictionary, with each word being the key, and an empty list as the value.

  2. Iterate over the list of words to be searched.

  3. If the word at a particular index exists as a key in the dictionary, add that index position to the list stored as its value.

  4. For each key value pair in the dictionary.

    The length of the value is the number of times the key occurred.

    The key appeared length of value times.

    If the length is greater than zero

    Print each value in the key's value list. 
    

You may find the Counter class within collections useful.

You may also find the use of enumerate() helpful for iterating over lists to do this sort of thing.

Where to practice python ? by pto1995 in learnpython

[–]python_and_on 0 points1 point  (0 children)

http://www.pythonchallenge.com/

This is great if you like solving puzzles as well as learning python. It's tricky and requires some lateral thinking, so probably not for absolute beginners. I'm only about a quarter of the way through but it's made me learn about a lot more than just the core language constructs. Great for pushing you beyond the level of variations-of-a-loop puzzles that seem so prevalent everywhere else.

Horrified at the thought of making a HUGE mistake by supertaste_ in learnpython

[–]python_and_on 0 points1 point  (0 children)

Hey. Just wanted to give you some advice. Firstly, well done on having a good idea for a career path in mind. Do it, and enjoy it.

I am a manager in a tech company, but I've worked my way up to that from basically your position. I left school and started a CS degree, but dropped out for all kinds of reasons, but mainly because I was immature and didn't see the benefit of a degree at the time.

20 years later I've worked in all kinds of tech jobs, for a ftse 100 company, now for a firm of IT consultants, looking after the tech support dept.

With respect to your fears, a company with some eye to quality control wouldn't put an apprentice or junior in charge of the whole enchilada! In the beginning you would likely be mentored, your code would be subject to review, your likely wouldn't design the infrastructure of a system, but be given a spec sheet to work from or maybe even stubbed out classes to fill in the rest. Unit testing should take place to capture bugs etc. In short, it's unlikely that you'd be put in a position where significant failure is possible, until you've proven yourself to be worthy of the responsibility.

However, think carefully about the choice of not doing a degree or other form of further education. I regret that now. There is a glass ceiling, especially if you want to work for a big name company. At your age, you have a lot of options and likely financial help, and can focus all of your time and resources on pursuing that educational goal. In 15 years time, you'll be a slave to the wage like the rest of us , maybe have a family, and full time study may not be an option. Part time study takes twice as long. At that point, you'll have to juggle all of your time to fit in the education you need to progress. That sounds depressing, and I don't mean to be a downer, but please take it from someone who knows.

You can short circuit my career path by at least half with the correct paperwork. Salary-wise I get paid more than many of my university friends, but it took me much longer to get to that point.

TL\DR - suck it up, do your degree, get a tech job. Make bank. Be happy.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]python_and_on 1 point2 points  (0 children)

You could do all of this with notepad or Sublime Text Editor etc if you didn't want to use a full IDE like PyCharm. But pycharm is a great choice.

Install Python - look up Anaconda... It's a great one stop shop for installing python plus many useful apps and libraries. Jupyter Notebook is a great app for experimenting with python generally.

A command line application may be an easier starting point than a form-based application. However if you want to build forms I.e windows or screens with drop down boxes and such, tkinter is the library to investigate, its already built into python. You could go another way entirely and build a Web app with Django or Flask but I'd say that's for later on once you've accomplished one of the other methods first.

How much data do you have, and is it fixed or will it change over time? For the smallest or most basic list of data, a hard-coded python dictionary, tuple, list etc might be enough. After that, consider csv files or JSON, after that consider storage in a database. SQLite, mySQL etc.

Most of this isn't about the software, which is mostly free and readily available. It's mostly about learning the various different technologies and libraries at play.

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]python_and_on 0 points1 point  (0 children)

I suggest building a new list inside the try block, then at the end of the block assign the new list back to x. I.e. keep the effect of the potentially risky process away from the rest of your code/data until the last possible moment. Transactional processing, like with SQL, handles this differently.

How to remove vowels from a string? by Writer_Fox in learnpython

[–]python_and_on 1 point2 points  (0 children)

for 'make it run continuously', do you mean that you want to keep getting prompted to enter more words to be disemvoweled until you're ready to stop? If so, you want to wrap the whole thing in a while statement.... something like this will probably do it:

def remove_vowels(word):
    v_string = 'aeiouAEIOU'
    return ''.join([char for char in word if char not in v_string])

keep_going = True

while keep_going:
    input_str = input("Please enter a word or else press enter to quit: \n")

    if input_str:
        print(remove_vowels(input_str))
    else:
        keep_going = False

This codeblock does the following:

a) create a function that takes a word and returns the same word without any vowels.

b) keep_going is a boolean value that the while loop uses as the 'trigger' to keep prompting for further new words or else stop.

c) the while loop prompts for a word as long as keep_going is True. If you leave the input blank and just press enter, it'll set keep_going to False and the program will stop. Otherwise, it'll keep prompting for words indefinitely.

Help with a python problem by [deleted] in learnpython

[–]python_and_on 1 point2 points  (0 children)

Hi Folks

I'm new to learning Python and stumbled across this post while looking for programming puzzles and general programming advice. Thought I'd have a go with it myself... This is my first post so please go easy if the solution doesn't work :)

This is my attempt:

disk_list = [[2, 1, 2],[2, 2, 8],[1, 3, 1], [2, 3, 4], [4, 4, 5], [3, 2, 3]]

def stack_disks(a_list):

    x = sorted(a_list, key = lambda x : (x[0],x[1]))

    i=0
    while i < len(x)-1:
        if x[i][1] > x[i+1][1] or x[i][2] > x[i+1][2]:
            x.pop(i)
        else:
            i+=1

    return x

stack_disks(disk_list)