User Profile
Collapse
-
Why dont you assume one value, say a, as highest and an other, maybe e, as the lowest and check each value(b,c,d,e and a,b,c,d) one by one against the assumed values. This logic should reduce the number of comparisons required. It'll look a lot cleaner too. -
Either your scraping logic is wrong or the website changed its source code after you used your logic. I would suggest you to use. BeautifulSoup to extract the data.
BS is a third party library but famous due to is helpfulness.
Use BeautifulSoup to extract the table that has the required values.And then extract the required table row depending on the type of gold chosen by the user.Leave a comment:
-
You could store all the elements of the 2D array into a 1D array, sort that array, and update the values
Of the 2D array with values from the sorted 1D array.
Is it necessary that you have to perform bubble sort on the 2D array as a whole?Leave a comment:
-
-
char rawdata[]="2_three_01_si x"
int i = 0
while i<rawdata.lengt h()
{
if string.isdigit( rawdata[i]) && rawdata[i-1]!='_'
print rawdata[i]
i=i+1
}
Will this work?? @weaknessforcat sLeave a comment:
-
-
For developing logic. first go through simple programs like finding fibonacci numbers. and so on. Once you have gone through enough of those programs, you'll learn to apply similar logics in programs of the same level. Keep doing that and keep increasing the standard of programs you are going over gradually. Logic will slowly come to you!Leave a comment:
-
Reading Mail Headers in Python
Can someone please tell me the code that'll help me extract the email id of the last person who sent me a mail(label="Inb ox").Im using imap by the way.
Thanks! -
recursion 1:
a=2 b=5 m=1 n=3
recursion1.1:
a=2+1 b=5 m=1+5 n=2
recursion 1.1.1:
a=3+6 b=5 m=6+5 n=1
recursion 1.1.1.1:
a=9+11 b=5 m=11+5 n=0
return
print-> 20 5 16 0
The second recursion call makes it very complex. you have to handle two recursions that are kinda nested.
Working out the second part....I guess...Leave a comment:
-
-
Abstraction:
you hide unnecessary details from the user.The user only has to know what he needs to know.For example,when you use the sqrt() function,you have no idea of what is happening behind the screen.All you need to know is that,if you pass a number to sqrt(),it will return the square root of the number.The logic used in finding the squareroot is hidden from you.
Polymorhism:
The ability of something(usual ly functions) to processed...Leave a comment:
-
you basically print a 2d array in the form of a matrix using two loops.One nested inside another.One loop to control the row and the other to control the column.Leave a comment:
-
-
use this:
int n[4];
cout<<"Enter the four numbers:";
cin>>n[0]>>n[1]>>n[2]>>n[3];
int largest=a[0];
int smallest=a[3];//these are temporary.
for(int i=0;i<4;i++)
{
if(a[i]<smallest)
smallest=a[i];
if(a[i]>largest)
largest=a[i];
}
you may split it up into two loops if you want them as separate functionsLeave a comment:
-
Put semicolon after the class declaration. That should do the trick.Leave a comment:
No activity results to display
Show More
Leave a comment: