i have just been learning python(tuple) at school. And this is my first assignment. I can't seem to figure it out.

The assignment is on this website: http://schools.tdsb.on.ca/danforthcti/python/main.html
Go to lesson 8>scroll down>its called programming Assignment 9.

Can someone help me out? It's simple enough right? thank you!

Yes, it's simple enough. The example given started out with mypocket = ("gum", "wallet", "old kleenex", "bus ticket") . Was there something unusual about this that prevented you from extending that from 4 items to 10?

the assignment says to : "The program will then ask you how many items you want from the tuple, and then output them to you."
I don't know how to do that part....

Hi,
I think its very simple.
I will give you rough idea about it.

first, use raw_input() for asking user to enter number.

number =raw_input('How many item you need ?')

define tuple.
like

my_tuple = range(1,10)

then use random library for random selection

import random
random.sample(my_tuple,number )

got no time to write proper program but this will help you out. let me know if you want me to write program.

mypocket = ("gum", "wallet", "old kleenex", "bus ticket")
input_user = int (raw_input('How many item you need ? \n'))
for i in range(input_user):
    print mypocket[i], 
    #this will print from first to the limit of range
    #No catching of exceptions
    #use random module to randomize selection

Yes, it's simple enough. The example given started out with mypocket = ("gum", "wallet", "old kleenex", "bus ticket") . Was there something unusual about this that prevented you from extending that from 4 items to 10?

I know how to do that part... obviously.
Theres 2 parts to that question.... >.>" did u not read it all?

I know how to do that part... obviously.[...]

That doesn't square with what you said in the original post ... you know ... the part that reads "I can't seem to figure it out." For all I know, English isn't your native language. Just wanted to make sure we start out with common definitions.

Also it appears you have not read the homework assistance announcement. Generally what goes on here is you post what code you have written (following syntax highlighting guidelines) and lots of folks will be glad to help. But most folks (evidently not all) want you to show some effort first.

commented: you handled that well +11

I've flagged this as a bad post. Since this is the first time, hopefully it was done correctly. This was the message:

This post is from someone who posted a link to their homework assignment, with no attempt to code anything themselves, and then asked for the answer. Further, they berate someone for not reading the homework assignment completely. Any one who is too lazy to cut and paste the question into the forum should not criticize someone else. We don't want to encourage the attitude of, "I'll sit here on the veranda in my rocking chair while you go fetch the homework from the web for me, and then code the answer while I sit here rocking away". Obviously, this violates the "only help those who shown some effort" and also violates the "keep it pleasant" guidline.

That doesn't square with what you said in the original post ... you know ... the part that reads "I can't seem to figure it out." For all I know, English isn't your native language. Just wanted to make sure we start out with common definitions.

Also it appears you have not read the homework assistance announcement. Generally what goes on here is you post what code you have written (following syntax highlighting guidelines) and lots of folks will be glad to help. But most folks (evidently not all) want you to show some effort first.

You are correct! If the OP will keep going with this attitude, I will give an infraction.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.