I don't need it to find the negative numbers, I need the -4 to return as an empty list. the output should look like this
[0, 1, 1, 2]
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
[]
User Profile
Collapse
-
How to organize a function that computes the fibonacci sequence
I am trying to create a function that prints the first 4 numbers in the fibonacci sequence, the first 10 numbers in the fibonacci sequence, and then "the first -4" numbers in the fibonacci sequence. The "-4" numbers in the fibonacci sequence should return an empty list because there is no "-4" numbers in the sequence. I need the function to print the 3 lists as an end result in the main() function. Here is my code so... -
Find the percent of cars over the speed limit?
In this program I am attempting to compute the percentage of cars that exceed the speed limit, I figured out how to create the list of cars, and I made it so the user picks the speed limit, but now I'm unsure how to print out the calculated percentage of cars over the speed limit. I know the equation should probably look something like the number of cars over the speed limit divided by numCars. I'm very new to programming so any form of help would... -
I changed the > to a < and it finds the slowest,thanks for the tipLeave a comment:
-
calculating slowest speed
Hello,
I'm trying to change this script so that it calculates the speed of the slowest walker rather that the fastest walker. I know the change needs to happen in the while or if loop, but I don't know what exactly to change.
I'm still new to python and I'm not really sure where to start, any help would be appreciated. Thanks!
...Code:num_walkers = float(input("How many walkers in your group? ")) dist -
How to make a program to calculate tax
I'm trying to make a python program that
1) prompts the user to enter the value of the sale with the following statement:
“Enter the value of the company’s sales in dollars in August 2013:”
2)The sale value should be stored in a variable of type float
3)Compute the sales tax based on 6% of the sale
4) Print the resulting sales tax in the following format:
“The...Last edited by bvdet; Jan 26 '15, 10:34 PM. Reason: Please use code tags when posting code [code]....[/code]
No activity results to display
Show More
Leave a comment: