Skip to content Skip to sidebar Skip to footer
Showing posts with the label While Loop

Generating Random Number With Different Digits

So I need to write a program which generates random numbers from 100 to 999, and the tricky part is… Read more Generating Random Number With Different Digits

How To Return Alphabetical Substrings?

I'm trying to write a function that takes a string s as an input and returns a list of those su… Read more How To Return Alphabetical Substrings?

How Can I Play A Sound While Other Lines Of Code Execute Simultaneously?

I want my code to do this, but with music playing in the background: import time while True: p… Read more How Can I Play A Sound While Other Lines Of Code Execute Simultaneously?

Script Breaks Out Of Function After Sending A Few Packets

I am writing a python program that sends packets for a specified amount of time. The sending script… Read more Script Breaks Out Of Function After Sending A Few Packets

While Loop Creating

I am writing a program in Python that defines a function that takes a single argument. The function… Read more While Loop Creating

How To Store Results From While Loop And Sentinel In Python?

been working on this for hours, thought i had it down but it turns out i have it all wrong. The as… Read more How To Store Results From While Loop And Sentinel In Python?

Why While Loop Is Sticking At Raw_input? (python)

In the following code i am trying to make a 'more' command (unix) using python script by re… Read more Why While Loop Is Sticking At Raw_input? (python)

Have Extra While Loop Conditions ... Based On A Condition?

The variable a can take any number of values. The value of a is the amount of extra pre-defined con… Read more Have Extra While Loop Conditions ... Based On A Condition?

While Loop Guessing Number Game - Python

I'm trying to make a 'guess the number between 1-10' game but the while loops seems to … Read more While Loop Guessing Number Game - Python

What's The Difference Between "while 1" And "while True"?

I've seen two ways to create an infinite loop in Python: while 1: do_something() while Tr… Read more What's The Difference Between "while 1" And "while True"?

Counting Data Points Within Limits, And Applying Buffer To Isolated Points [data Analysis]

I am stuck trying to solve this problem: I have a set of data points, that correspond to a set of t… Read more Counting Data Points Within Limits, And Applying Buffer To Isolated Points [data Analysis]

While Loop Alternative In Python

I am working on a huge dataframe and trying to create a new column, based on a condition in another… Read more While Loop Alternative In Python

Python 'if' And 'while' Conditions Not Working

I am writing a simple Python program. It's supposed to read two sorted lists from tab-delineate… Read more Python 'if' And 'while' Conditions Not Working

Python Sleep For Memory Consumption Measurement Not Accurate

i have a python script (runner.py) which regularly measures memory consumption of a process. to mon… Read more Python Sleep For Memory Consumption Measurement Not Accurate

Python While Loop - Variable Not Updating?

This code simply looks for a string in another string and returns the last postion of the occurance… Read more Python While Loop - Variable Not Updating?

Why Won't The While Loop Continue And Stop After A User Question?

questionnumber=0 color=('Red') userask=input('What color of the rainbow am I thinking o… Read more Why Won't The While Loop Continue And Stop After A User Question?

Executing One Line Of Code Inside A While Loop Only Once

How do I make a specific line of code execute only once inside a while loop? I want the line: '… Read more Executing One Line Of Code Inside A While Loop Only Once

Counting The Input In A While Loop?

I need help with a function I have to write which includes a while loop that will continue going un… Read more Counting The Input In A While Loop?

Can You Break A While Loop From Outside The Loop?

Can you break a while loop from outside the loop? Here's a (very simple) example of what I'… Read more Can You Break A While Loop From Outside The Loop?

While Loop Not Counting Correctly

I've been learning programming in python for the last two weeks and it's going great so far… Read more While Loop Not Counting Correctly