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

Simple While Loop Until Break In Python

What would a very simple while loop statement be that would continue the below program until the us… Read more Simple While Loop Until Break In Python

Variable Scope In For-loop And While-loop

I'm new in PHP, I don't understand why the final result of the code below is '233' … Read more Variable Scope In For-loop And While-loop

Gradients Error Using Tensorarray Tensorflow

i am trying to implement multidimentional lstm in tensorflow, I am using TensorArray to remember pr… Read more Gradients Error Using Tensorarray Tensorflow

Closest Prime Number In Python

I need a user to enter a number and enter out the closest prime number to the value they put in. I … Read more Closest Prime Number In Python

Python While Loop Syntax

class Solution: def display(self,head): current = head while current: … Read more Python While Loop Syntax

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)

Strange Python While Loop Behavior With < Comparison

I'm confused with this snippet of code: t=0 while t Solution 1: 5 isn't necessarily 5: t=… Read more Strange Python While Loop Behavior With < Comparison

Python Code That Returns True While Key Is Pressed Down False If Release?

I need a code in python that returns an if statement to be true if a key is pressed and held down a… Read more Python Code That Returns True While Key Is Pressed Down False If Release?

While Loop Fail - Caesar Cipher

I'm having a problem where when I ask my program to quit out it prints like I ask it to, howeve… Read more While Loop Fail - Caesar Cipher

How To Use Raw_input() With While-loop

Just trying to write a program that will take the users input and add it to the list 'numbers&#… Read more How To Use Raw_input() With While-loop

Python: Trying To Use 'count' To Limit The Amount Of Lines "print" Will Output

I have a script that will walk a system directory, and get the files sizes in that directory. it th… Read more Python: Trying To Use 'count' To Limit The Amount Of Lines "print" Will Output

Sum Of Elements Using While Loop

I am trying to get a sum of all elements using while loop. from numpy import * x = array([1, 23, 43… Read more Sum Of Elements Using While Loop

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

Grade Average Calculator

Here is the question I am working on : You want to know your grade in Computer Science, so write a… Read more Grade Average Calculator

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"?

Received "unboundlocalerror: Local Variable 'e' Referenced Before Assignment" When The Variable Was Initialized

[Community edit to give reproducible example:] def main(): e = None print(locals()) whi… Read more Received "unboundlocalerror: Local Variable 'e' Referenced Before Assignment" When The Variable Was Initialized

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]

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?

Python - Appending List To List During While Loop - Result Not As Expected

Python/programming newbie here, trying to figure out what is going in with this while loop. First t… Read more Python - Appending List To List During While Loop - Result Not As Expected

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