No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I've been asked to write a program that computes the nth Fibonacci number where n is a value input by the user. For example, if n = 6, then the result is 8. This is what I have so far: def main(): print "This program will compute nth Fibonacci" print … |
|
I created a function that creates smiley faces. I want to print more than 1 (with different size and location) on 1 window. How do I do it? Here is the code: [code=Python] from graphics import * def main(): print drawface(Point(40, 40), 20, GraphWin) print drawface(Point(90, 90), 30, GraphWin) print … |
|
I'm trying to give python a list of numbers like this (5 6 7) and I want it to square each number (or as many numbers as I input). I'm trying out a list comprehension on this. I'm not sure where I'm going wrong. Any help would be great. [code="Python"] … |
|
So I've written a code to get an acronym of the phrase inputed by the user. The only problem is that it insert an extra line in the result which I don't need. I'm not sure what is causing it. Here is the code and the results: import string def … |