#!/usr/bin/env python # -*- coding: utf-8 -*- """ Python solutions for Prof. Dhande's homework fifth problem (week 2). """ print "Problem #5 : Input an integer K, enumerate and print the first K odd integers." K = input("Give me an integer K = ") n = 1 while n < 2*K: print n n = n + 2 # n += 2 also works fine