1)Create a list of the odd numbers between 1 and n (include 1 as well as n -- if it's odd-- in the list). Associate the list with the variable odds .

2)Given the list my_list containing integers, create a list consisting of all the even elements of my_list . Associate the new list with the variable new_list .

3)Create a dictionary that maps the first n counting numbers to their squares. Associate the dictionary with the variable squares .

if "EMERGENCY" or "Help" or "!" in heading:
   pass
elif ("no idea" in body) or (not Code() in body):
   pass

Edited 7 Years Ago by woooee: n/a

Comments
Like the only original poster in the thread :S

Kind off help whit some clear messages.

>>> we_dot_do_homework_if_no_effort_is_shown = 2
>>> 1 % we_dot_do_homework_if_no_effort_is_shown
1
>>> 2 % we_dot_do_homework_if_no_effort_is_shown
0
>>> 3 % we_dot_do_homework_if_no_effort_is_shown
1
>>> 4 % we_dot_do_homework_if_no_effort_is_shown
0
>>> stupid = 3
>>> show_effort = 4
>>> if stupid % we_dot_do_homework_if_no_effort_is_shown == 1:
	print'Odd'
else:
	print 'even'

	
Odd
>>> if show_effort % we_dot_do_homework_if_no_effort_is_shown == 1:
	print'Odd'
else:
	print 'even'

	
even
>>>

Edited 7 Years Ago by snippsat: n/a

Halo_123 next time do your homework and show us what you did so we CAN help you insead of DOING IT FOR YOU.

i think this sums it up: (comp im using doesnt have python, so its in plain text, lol)

#read the following and reflect on it before you post another
#thread like this please. It says somwhere on daniweb that you have
#to TRY first before a daniweb member will help you.

print "Please do your homework first halo, then ask us for help"

Please do your homework first halo, then ask us for help

Edited 7 Years Ago by python user: n/a

i think this sums your problem up pretty good:

def Myfunc():
print "Stuff"
print "Halo_123, please do your homwork first, then ask us how."
Halo_123, please do your homwork first, then ask us how.

sry for the double post...just had to add [code] tags to it.

Edited 3 Years Ago by Reverend Jim: Fixed formatting

It is LEGAL to ask for starting point, or for PROBLEM in coding But it drives me bananas someone wants his/her homework done. Oh! Why did you go to college/School then?? :lol:

The first problem could be kind of easy:

n = 11
for odd_number in range(1, n+1, 2):
    print( odd_number )

"""
1
3
5
7
9
11
"""
This question has already been answered. Start a new discussion instead.