Skip to content
Advertisement

Tag: while-loop

Problem: While loop won’t re-run the program properly

Result: Currently, my program will print a score depending on what the user enters. After the first input, ‘fazli’ the score was 17. My while loop is supposed to keep running until the user enters nothing. The problem is my while loop I believe. It won’t make a new score, it only copies the first one. How can I keep

im having trouble with this code, although it works but not the way i want

In this code if i put the right username and wrong password, I get the “Wrong, Try again”, but if I put the wrong username and wrong password, i still get the “You have logged in successfully” help please, thank you <3 Answer There’re two conditions in your loop: entered_username in users ; users[entered_username] != entered_password . If any of

Using a for-loop and range function vs a while-loop

I’m looking for a function like range except that the step is a fraction of the previous number generated. So if the fraction was 99/100 the set of numbers might be something like this: 100, 99, 98.01… 0.001 Would this be more efficiently done with a for-loop and range-like function or with just a while-loop? The code I have so

How can I use the content of a file as a condition?

I installed AutoKey on my computer so I can execute python files with the keyboard, and what I want to do is execute a script as a loop but also being able to stop it. The script presses the “d” key on my keyboard, waits around 2.4 seconds, and then presses “s”. What I thought would be a good idea

If a table has columns equal to columns in a second table insert values in a third table, python – mysql

I have 3 table in my database: Borrowers: amount of the loan, interest rate, borrower id (PK) Lenders: amount of the bid, interest rate and LenderID (PK) Contracts: ContractID PK, amount, interest rate and the two foreign key(borrowerID, lenderID) I create a loop in python with an input command in which I can insert new request of loan and new

Python – Trying to print each line that has a string value that matches the index provided

Now I’m still pretty new to python and programming in general, but I know I’ve gone a bit of a roundabout way this entire program. But here is what I have and what I want if anyone can help. Begins by reading a text file e.g. ADF101,Lecture,Monday,08:00,10:00,Jenolan,J10112,Joe Blo ADF101,Tutorial,Thursday,10:00,11:00,Jenolan,J10115,Cat Blue ALM204,Lecture,Monday,09:00,11:00,Tarana,T05201,Kim Toll Then I make empty lists and append them

Advertisement