Python Forum
Help in displaying odd numbers from 1 to 100 in py
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help in displaying odd numbers from 1 to 100 in py
#7
(Apr-27-2017, 04:43 AM)RandoomDude Wrote: This is my attempt  :  
for k in range(1,101,2): 
print(K)
But it shows following error

Error:
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> for k in range(1,101,2): print(K) SyntaxError: expected an indented block
Except for the indentation error, you will get NameError after indentation is ok. In print() you are using upper K
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
RE: Help in displaying odd numbers from 1 to 100 in py - by wavic - Apr-27-2017, 07:30 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Print Numbers starting at 1 vertically with separator for output numbers Pleiades 3 3,779 May-09-2019, 12:19 PM
Last Post: Pleiades

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020