0 points
over 6 years

# List & Functions 2/18

n = [1, 3, 5]

print n[1] * 5

I’ve looked in the forums, it still keeps saying “did you multiply the second element?” Help would be very appreciated.

Thank you

n = [1, 3, 5] n[1] = 5 * n[1] print n

points
Submitted by Onurien
over 6 years

Thanks.

RyanBawden over 6 years

that dosent work

21271808_UWL over 6 years

this works! thanks :)

whatsyourpoint over 6 years

thx a lot!!!

WenlinWang over 6 years

Thx!!!!!!!

орест муха over 6 years

Thank you!

mingtiao over 6 years

thx~

swegabe over 6 years

no, thank YOU ;)

1 vote

there are many ways 1.n[1] = n[1] * 5 2.n[1]= n[2] * 3 3.n[1]= 5 * 3 all of it works

points
Submitted by Benny wijaya
over 6 years

I had the same issue a moment ago and figured it out.

For starters, you only need `print n` on the last line.

But aside from that, the issue I had was I forgot the print the entire list within n (I only printed 15, it wants you to change n[1] to that result and print all three numbers inside the n list).

That should be enough info to figure it out without actually giving away the full code.

points
Submitted by AnalyticAssault
over 6 years

Thank you, thank you.

AnalyticAssault over 6 years

I can tell you and I are using pretty much the same stuff on this site :-)

Another free resource on python I find useful are Udacity’s courses that make use of it:

https://www.udacity.com/course/cs101

https://www.udacity.com/course/ud036

I like codecademy better as a way to get the feel for python since Udacity is (mostly) video based, but you can skip vids and see if you understand problems without them to try and save time.

Thanks for the links, do you happen to know any free resources for c++?

AnalyticAssault over 6 years

Hmmm, I don’t know any off the top of my head but after python I recommend learning Javascript (which - like python - is also a relatively easy language used for scripting purposes), and then the first C-based language I intend to learn is Java (which udacity has a course on).

Generally speaking if you know one c language (C, C++, or Java), it’s not that hard to learn one of the others.

Since C++ is a relatively low-level language (meaning the code is “closer” to the zeros and ones a computer processes) it’s definitely harder to learn than python.

Josh over 6 years

thanks! I had the same problem

I made crazy solution =) But it works.

n = [1, 3, 5] z = (n[1] * 5) n.insert(1, z) del n[2] print n

points
Submitted by shasteedez
over 6 years

`n = [1, 3, 5]` `# Do your multiplication here` `n[1] *= 5` `print n`

points
Submitted by Julian Zalenski
over 6 years

THIS IS A GOOD ANSWER TO 2/18 n is equal to 1 3 and 5 n1 is 5 times n1 then you print the n

n = [1, 3, 5] n[1] = 5 * n[1] print n

points
over 6 years

``````n = [1, 3, 5]