Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Program debugging (python)
Post: RE: Program debugging (python)

(Jan-17-2019, 04:22 AM)ichabod801 Wrote: That's because you are checking is_magic(str_list). That should be is_magic(square). Oh my god... i dont know how to thank you enough...
abdullahali Homework 5 3,316 Jan-17-2019, 04:26 AM
    Thread: Program debugging (python)
Post: RE: Program debugging (python)

(Jan-17-2019, 04:01 AM)ichabod801 Wrote: I don't get that error. I get a later error on line 11, because you never convert the strings to integers. I think you want to replace the str call on line 4...
abdullahali Homework 5 3,316 Jan-17-2019, 04:15 AM
    Thread: Program debugging (python)
Post: Program debugging (python)

Hello, I am trying to create a program that asks user for sequence of 9 numbers and then verifies if they . make a magic square or not. Magic square requirments: rows, coumns and diagonal all sum up t...
abdullahali Homework 5 3,316 Jan-17-2019, 03:45 AM
    Thread: IndexError: list index out of range
Post: RE: IndexError: list index out of range

Yes, i input 123456789 and keep getting that error (Jan-16-2019, 10:37 PM)nilamo Wrote: What's your input? Is it at least 9 numbers long? Yes sir, my input is 123456789 for example.
abdullahali Homework 4 3,863 Jan-16-2019, 10:53 PM
    Thread: IndexError: list index out of range
Post: IndexError: list index out of range

N = 3 # Returns true if square is magic # square, else returns false. def is_magic(square): # calculate the sum of # the prime diagonal sum = 0 for i in range(0, N): sum += sq...
abdullahali Homework 4 3,863 Jan-16-2019, 10:24 PM
    Thread: Python arrays
Post: RE: Python arrays

Sorry. I tried array2 = np.array(data2) and it eventually worked. But now i am supposed to convert my data2, which is a list of strings to integers. I tried for i in range(len(data2)): data2[i...
abdullahali Homework 3 3,174 Oct-30-2018, 04:56 PM
    Thread: Python arrays
Post: Python arrays

How could I convert my list that is associated with variable data2 to a 2D numpy array?
abdullahali Homework 3 3,174 Oct-30-2018, 03:19 PM
    Thread: Python lists help
Post: RE: Python lists help

Yes thats exactly what I needed, thank you so much!
abdullahali Homework 2 2,460 Oct-08-2018, 11:56 PM
    Thread: Python lists help
Post: Python lists help

So I am supposed to Use a single list comprehension to create a list of lists where each sublist consists of a pirate’s name, and the value of his/her plundered sacks of grain (calculate grain values ...
abdullahali Homework 2 2,460 Oct-08-2018, 11:12 PM
    Thread: Need help
Post: Need help

praire_pirates = [['Tractor Jack', 1000, True], ['Plowshare Pete', 950, False], ['Praire Lily', 245, True], ['Red River Rosie', 350, True], ['Mad Athabasca McArthur', 842, False],['Assiniboine Sally...
abdullahali Homework 1 2,237 Oct-08-2018, 01:19 AM
    Thread: Code isnt working
Post: Code isnt working

Write the definition of a function powerTo which recieves two parameters, a double and an integer. If the second parameter is positive, the function returns the value of the first parameter raised to ...
abdullahali Homework 5 3,405 Sep-28-2018, 02:25 AM
    Thread: Not getting a return value
Post: Not getting a return value

def fuel_efficiency(fuel_used, distance): fuel_used = int(input("enter the fuel used: ")) distance = int(input("enter distance travelled: ")) fuel_efficiency = (fuel_used / distance) *100 ...
abdullahali Homework 1 2,046 Sep-25-2018, 01:03 AM
    Thread: HOMEWORK HELP
Post: HOMEWORK HELP

Hey guys, I have been given a list of questions to answer using this code. Ive answered some of them but some I have no answer for and would appreciate help and explaining. (a)List all of the functio...
abdullahali Homework 1 2,481 Sep-24-2018, 08:55 PM
    Thread: new to coding
Post: new to coding

Hello, I am trying to write a program that reads the user’s fuel used and distance travelled from the console, passes the entered values to the fuel_efficiency function to perform the computation, ob...
abdullahali Homework 3 2,629 Sep-23-2018, 04:40 AM
    Thread: Homework help
Post: Homework help

How can I add a $ sign to this total_value = int ( Input (“total value of booty in dollars: ”))
abdullahali Homework 4 3,015 Sep-17-2018, 07:39 AM
    Thread: HOMEWORK HELP
Post: HOMEWORK HELP

Hey, i am new to python, and trying to do this assignment Write a program for Tractor Jack that will ask the user to input the total value of booty plundered (in dollars), and the number of crew (n...
abdullahali Homework 1 2,049 Sep-17-2018, 06:17 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020