jden251566


Joined 1 year ago
Homeworks submitted:
Homework comments:
1
0

About Me

No description provided.

Classes

MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming

Class status: Established
Role: Student
. 5% complete

Submitted Assignments

MIT OpenCourseWare 6.00 Introduction to Computer Science and Programming: Lesson 8, HW 1

I wanted to get feedback on my answer to question #4, as the way I coded it seems to work but seems much different from the solution provided.

def first_N(n):
  if n <= 0:
    print 'Must enter a positive integer'
  else:
    for intnum in range(n*2):
      intnumsq = intnum * intnum
      if intnumsq%2 != 0:    # if intnum is odd number
        print intnumsq

jden251566 1 year ago