Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: New to python via Prof Chuck Severance
Post: RE: New to python via Prof Chuck Severance

Place your code within tags when posting so that its readable. You can refer to the instructions in the below link. https://python-forum.io/misc.php?action=help&hid=25 You could have made some m...
Pranav Homework 3 1,917 May-23-2020, 01:22 AM
    Thread: Print the frequency of each coin for the combinations that sum to the amount N
Post: RE: Print the frequency of each coin for the combi...

Please suggest if the above problem can be solved using iteration as well. If possible then please let me know the logic that can be applied.
Pranav Homework 3 2,572 May-19-2020, 06:16 AM
    Thread: Print the frequency of each coin for the combinations that sum to the amount N
Post: RE: Print the frequency of each coin for the combi...

Thanks for your help. I am able to get the desired output now. The below code was used n=4 arr=[1,2,4,3] arr1=[] """Function to calculate the number of different combinations""" def changes(amo...
Pranav Homework 3 2,572 May-17-2020, 03:57 PM
    Thread: Problematic Assignment
Post: RE: Problematic Assignment

You have only provided the output. Kindly provide the input values for the rate and hours. Also enter the code within the proper tags so that its readable. Click on the insert python option and place...
Pranav Homework 3 1,977 May-17-2020, 06:59 AM
    Thread: Print the frequency of each coin for the combinations that sum to the amount N
Post: Print the frequency of each coin for the combinati...

Description: The different combinations of the coins in the range of 1 to N that sum to the amount N needs to be printed. I have used recursive function for printing the different coin combinations. ...
Pranav Homework 3 2,572 May-17-2020, 06:19 AM
    Thread: I need help to solve this task using while statement
Post: RE: I need help to solve this task using while sta...

Try using the following steps. Within the function declare a variable k and check the condition within the while loop. k=1 while(k<(n-1)): .....step1 .....step2 k+=1 STEP1...
Pranav Homework 6 9,321 Mar-18-2020, 07:17 AM
    Thread: Fetch student details from a text file and print the details.
Post: RE: Fetch student details from a text file and pri...

The code is working fine. Thanks.
Pranav Homework 2 6,275 Mar-17-2020, 09:36 AM
    Thread: Fetch student details from a text file and print the details.
Post: Fetch student details from a text file and print t...

I am getting the desired output for this problem but feel that my code is very long. Please suggest if its possible to shorten the code and make it better. METHOD USED 1.The details of the students ...
Pranav Homework 2 6,275 Mar-17-2020, 07:10 AM
    Thread: Guess the number game
Post: RE: Guess the number game

You are taking the guess as an integer value but in the "if statement" you are checking whether its equal to a string value. This is wrong since you are trying to compare an integer value with a strin...
Pranav Homework 5 3,227 Mar-03-2020, 07:13 AM
    Thread: Need help with "IndentationError: expected an indented block"
Post: RE: Need help with "IndentationError: expected an ...

There is no indent space between the function declaration and body. It should be like this. def print2Smallest(arr): arr_size = len(arr) if arr_size < 2: print "invalid output" returnText...
Pranav Homework 3 6,558 Mar-02-2020, 06:26 AM
    Thread: How can details be dynamically entered into a list and displayed using a dictionary?
Post: RE: How can details be dynamically entered into a ...

Thanks for your response. Your solution was simple and effective. Below code is working fine. a=int(input("Enter number of dictionaries that you want to create\n")) """Function to take the list val...
Pranav Homework 5 2,960 Mar-02-2020, 06:05 AM
    Thread: Check Array for numbers
Post: RE: Check Array for numbers

(Mar-01-2020, 06:45 PM)ndc85430 Wrote: Pranav, is it really appropriate to provide a solution for someone? I am new to this forum. Will only explain the logic and provide minimal code henceforth.
Pranav General Coding Help 7 3,361 Mar-02-2020, 05:52 AM
    Thread: How can details be dynamically entered into a list and displayed using a dictionary?
Post: How can details be dynamically entered into a list...

Please help me out with the below problem. It is mandatory for the input to be in the below format. INPUT: Enter number of dictionaries that you want to create 3 First value is a string then three ...
Pranav Homework 5 2,960 Mar-01-2020, 05:43 AM
    Thread: Check Array for numbers
Post: RE: Check Array for numbers

The below code should work fine. The string is split when a white space is found and stored to a list. For loop is used to determine whether the element is a string or an integer. a = "donkey 2 pir...
Pranav General Coding Help 7 3,361 Mar-01-2020, 04:21 AM

User Panel Messages

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