Python pros, trying to teach myself python and I’ve got a problem where i have two files, input file and an output file. The input file contains 4 lines of characters (letters, spaces, etc) and i want to iterate through each character, and swap them for one another and then write the new set of lines to the out . Any tips? I know how to read/write the files, just can’t get the iterating and swapping characters part down

Posting as :
works at
You are currently posting as works at

numbers are naturally iterable, just += 1 in a “for [i] in [filename]:”
for letters, create a list with each letter as an item and do the same if statement, but go to the next item in list L[i+1]

The i + 1 convention always messes me up but i think that’s the way to go, I’ll look into that. thanks all

Depends on the data size. Assuming when you said 4 lines, it wasn’t an example. So, ingest the entire file and use Python operations using regex to substitute and write to another file

Related Posts

I find that I make careless mistakes when I do my work. Likely due to multitasking or maybe getting do you manage so many different clients, be responsive and maintain a good quality?


Fellow PMMs - what are the top 3 types of tasks and initiatives you actually focus on during a typical day/week? There are lots of articles and job descriptions out there - do they match your reality?
For example - content creation, project management, strategic marketing / planning, customer calls, serving as an input to product prioritization, etc.


How many offices are there of TCS in gurgaon and at what locations?


Have a HELOC with 7.5% adjustable rate (I know - bad idea from the beginning). 2 options - pay it off (do have funds now) or refinance this into the main mortgage at current rates. Thoughts?


Have several 1:1s scheduled tomorrow with a manager and some peers at a new job (industry). Trying to not be too nervous & I already wrote out questions I want to ask to get to know them better & their jobs better. But I’m still freaking out a little. I want them to like me and for us to get along. Tips to calm down?


If you are really interested in working for one of your clients, what's the best way to go about that?


This is regarding HRA claim.

We have recently built a new house in my hometown and im living with parents. The Land is on pur relative and we are yet to register it to us. So currently its not on my parents name.

I want to claim HRA by showing rent paying to my father. I guess i can create a rent agreement online. And i can file ITR for my father.

Will this work? Or it will cause any problem


What are common exit opportunities from business valuations - litigation support roles?


Hey there I work in a small company with big success year over year. I been in it for a year and my performance is just below average. (Working personal to improve that) I am working as a customer support agent and I am paid 55k CND a year. I get 4 weeks of paid vacation with full health benefits.

I am thinking around 7% annual pay increase. Does this sound reasonable or not?

P.s. I have 3 years of experience in the tech between on-prem, cloud support, custom software support. Also cert PDOOH.


Hi All,

I'm looking for referral in data engineering.
I'm having 2 year of relevant experience in data engineering.


I think I bombed a case interview with Chartis for an associate consultant position. The case was in excel and required me to manipulate the data via share screen with the interviewer. I couldn’t get some functions to work and was struggling to go through the 16 page PDF of data. I had several answers correct but needed to walk through the remaining questions with some guidance. My other 3 case interviews went well and I had great conversation with the partner for behavioral interview. Thoughts?


Can anyone from KPMG provide a rough estimate of bonus given out to Assistant Managers based in London in Consulting ? Trying to compare a couple of offers I have on the table


I’m trying to get into Salesforce, specifically the marketing and communications team. Any tips or people willing to refer me? And does anyone know what recruiting/headhunting agencies Salesforce uses? Thanks


Anyone have a 360 feedback process/procedure they’d be willing to share?


Hey, could someone pls let me know what can I expect or minimum I deserve in my next switch if I get 9.6 for 3 YOE in legal domain now? Can I ask for 20L+ or that's a big hike to ask for 3 YOE and profile might get rejected in the initial HR connect only?


Need a work backpack - want it to be back, small but able to fit my laptop, water bottle pocket and some organization within for keys, ID, phone, wallet, etc

What do people have that you like?


The ultimate question.

Post Photo

How can I connect with filmmakers to volunteer to be a part of their projects?


Additional Posts in Data & Analytics Consultants

I have a close buddy that worked for EY, and the environment was very toxic, but he was doing cyber security. Is this the case for other areas of the business, especially for analytics?


Is their a future in Power Bi ? Is it worth a certification? I have 2 YOE and looking to get a pay increase.


What are your thoughts on business rule engine systems like Apache Drools for data analysis? I love the idea that if I can set it up right, business users can configure exception reporting themselves without writing any code. But I haven’t seen a strong uptake in the market, so I’m guessing there must be some issues.


Any UK based data/business analysts here? What are your salaries looking like and YOE? It seems like people in data make way more in the US …


For people involved with infra on cloud, how the distribution looks like across IaaS, Container Orchestration Platforms and PaaS? Just curious about adoption across industries.


Have an interview with amazon soon. Any tips?

GitHub finally has an official dark mode. I can now die in peace 👀🩸


Working in a boutique data analytics firm on L visa. Seeking a career change and visa sponsorship into big tech companies. Not sure what role would be more suitable for my profile. Any guidance? If you feel profile a fit for your team. Let’s connect.

Profile snapshot:
YOE : 8+, 70% BI projects, 30% ML
Tech Skills: Tableau, SQL, Python , R , ETLs, Machine learning, Excel, PowerPoint, SparkSQL, DataBricks.
Additional: Consulting , problem solving, stake holder management, project management


Looking for folks for Associate, Associate Consultants, Consultant positions at ZS in the business technology space.

Experience in ETL, Reporting, Analytics.

Prior life science experience would be awesome(for a C specially) but not a must for A/AC roles.

Please DM me if you fit this criteria.


I got an offer from Hotstar strategy team, Want to discuss more about the team and the role if anyone is workinh in hotstar here


Have heard this a few times from recruiters: "1-10, how good are you at XYZ tech?"

What do you answer? I feel like there's really no choice but to say 6-7 if you want to say generally competent. Any lower, never getting past that screen. Any higher, you're gonna fail the later interview because of some obscure factoid


Just recently got accepted into UVA’s Masters in Business Analytics program and their guidance for computers doesn’t seem very helpful. Will be working with a variety of software, notably Jupiter notebook and Python, so want to make sure my computer can handle this. Currently have a 2015 MacBook Pro with 8gb of Ram, open to hearing if this will be sufficient or if I’ll need to upgrade and if so will be open to computer suggestions.


As AI practitioners, what do we think about singularity and simulation theory? Have come to the recent profound thought that as a technology loving human, my purpose on earth is to push myself and my work closer towards the AI-Human synchrony (driverless cars, wearable tech, neuralink, smart home, etc)


Hey Analytics Folks! Do any of you use JMP Pro? Need to understand if it’s a good tool to learn or should I invest my time in something more relevant. The intent is to learn and apply data mining...

What is the maximum expectation for a Deloitte 3rd year senior consultant salary in NYC within the AML Analytics practice?


What OS are you all using? I feel like Windows 7 is painfully outdated yet I don't see my current group making the transition to 10 anytime soon.

Does anyone else dream about coding if you work too late in the night, or just me?

MIS major here who wants to get more into analytics. Just started a project doing R (basics) and feel really behind due to my lack of the statistics behind it. Any advice aside from googl3 constantly?


Currently self taught with a communication degree, but do work using basic statistics and the usual Python libraries. Going back to school for CS- can I get some career advice on what doors open with


My small team needs some data architecture advice. We’re ingesting 2GBs of data from ~50 APIs daily, parsing that, and putting it in a PostgreSQL database, all in a single Rails monolith. (cont’d)


New to Fishbowl?

Download the Fishbowl app to
unlock all discussions on Fishbowl.
That was just a preview…
Sign Up to see all discussions
  • Discover what it’s like to work at companies from real professionals
  • Get candid advice from people in your field in a safe space
  • Chat and network with other professionals in your field
Sign up in seconds to unlock all discussions on Fishbowl.

Already a user?
Login here


Embed this post

Copy and paste embed code on your site


Download the
Fishbowl app

See what’s happening in your industry
from the palm of your hand.

A phone with Fishbowl app

Scan your QR code to download
Fishbowl app on your mobile

Download app

Sign up for free to view this conversation on Fishbowl

By continuing you agree to Terms of Use and Privacy Policy

Already have an account? Log in

Sign up for free to continue using Fishbowl

By continuing you agree to Terms of Use(New) and Privacy Policy(New)
Messaging rates may apply

Already have an account? Log in

For account settings, visit Fishbowl on Desktop Browser or