No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
8 Posted Topics
Hi there, creating new variable to add to a function, and when the user inputs a value, I get this: ValueError: need more than 2 values to unpack This is for sizeWindow variable by the way, I'll bold the parts I'm talking about. [CODE]from graphics import * def main(): doorColour, … ![]() | |
[CODE]# 619480 import time from random import * def main(): lst = [] result, length = 0, 500000 while result <= 0.50: for i in range(length): lst.append(randint(1, length)) value = randint(1, length) t0 = time.clock() linearSearch(value, lst) result = time.clock() - t0 print("This LINEAR SEARCH took {0:4.2f}seconds with a length … | |
In my code they're instructed to enter a width and height. However obviously these will be intergers, but I need to perform checks that they are intergers before they're used. Atm I've got this: [CODE] while True: if width.isdigit() == True and height.isdigit() == True: if width >= 2 and … | |
Re: Use while loops, if you've got the Zelle book read that, if not I suggest you get it. [URL="http://www.google.co.uk/products/catalog?hl=en&q=Zelle+python&gs_upl=2714l3336l3l3416l7l5l0l0l0l0l158l460l1.3l4l0&bav=on.2,or.r_gc.r_pw.r_cp.,cf.osb&biw=1920&bih=995&um=1&ie=UTF-8&tbm=shop&cid=1203857469452975753&sa=X&ei=y5joTtn5Hci2hQe0pbn3Cg&ved=0CE4Q8wIwAA"]Click here[/URL] While loops, if set to "True" basically means they will continuously cycle through the loop forever, unless you enter a "break" function within the loop's body if a certain condition … | |
Hello, The objective of my task is to allow the user to enter a series of colours (maximum and minimum of 4, and have to be within 5 set colours). I'm supposed to write code that continuously prompts the user if what they've entered doesn't meet the criteria. And also … | |
I'm attempting to create a number square when it's using a parameter. Whatever the user enters in the parameter it will display something like this (using 4 as an example): 4567 3456 2345 1234 I've come up this so far: [CODE]def numberedSquare(n): for a in range(n, 0, -1): print(a, end="\n") … | |
Hello again! I'm having trouble trying to double the value of my coordinates in my point. The object is to create a pair of eyes and their position is identified by clicking a point in the graphic window which would allocated the centre of the left eye, and the second … | |
Hello there, Currently doing some work for my coursework. I've noticed the "\n" is obviously the new line function or whatever you guys call it, but would you understand what I mean when I say it creates too much of a new line? For example, I want the newline to … |
The End.