-11

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 .

11
Contributors
11
Replies
21
Views
7 Years
Discussion Span
Last Post by PartVIII
Featured Replies
  • 1

    I assume the question is: [B]Who is foolish enough to do my homework for me?[/B] Read More

  • 1

    [CODE]if "EMERGENCY" or "Help" or "!" in heading: pass elif ("no idea" in body) or (not Code() in body): pass[/CODE] Read More

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

Edited by woooee: n/a

Votes + Comments
Like the only original poster in the thread :S
-3

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 by snippsat: n/a

0

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 by python user: n/a

0

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 by Reverend Jim: Fixed formatting

0

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:

0

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.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.