Bucky should like this one! First challenge

+3 Joshua Perkins · August 4, 2015
Run this little bad boy:

for n in range(101):
if 0 is n % 4 :
print(n)
else:
print('Bucky is awesome')




I also found a cheat:
a = 0
for n in range(101):
if n is a:
print(n)
a = (a+4)

Post a Reply

Replies

Oldest  Newest  Rating
+1 Otto Von Chesterfield · August 6, 2015
You should learn about code blocks.
0 nawras chahbandar · August 9, 2015
for x in range (101):
      if 0 is x % 4:
           print(x)
0 nawras chahbandar · August 9, 2015
'''
why we have to make it complicated !!!
it just a for loop with start and end and step ...

#just a simple loop program 
'''
for y in range (4,101,4):
      print (y)
0 Joshua Perkins · August 10, 2015


Otto Von Chesterfield · August 6, 2015

You should learn about code blocks.



OK.
0 Otto Von Chesterfield · August 10, 2015
The code blocks look like below:

def myFunc(thing, nums):
  print(thing)
  print(nums)

myFunc('Hello!', [1, 5, 10])

They're between the square w/ the green plus on the bottom-right corner  and  the dialogue chat bubble
0 Joshua Perkins · August 11, 2015

print("I'm a n00b")
print("Now I've gotta figure out the easy way to utilize font colour changes")
0 Otto Von Chesterfield · August 11, 2015

import sys

print("Oh no! This is usually in red to indicate an error!", file=sys.stderr)
print("This is default.", file=sys.stdout)



If you want red color, like above, then sys.stderr is for you. The std___ objects pretend to be a file output stream, when it really is your console.
  • 1

Python

106,943 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator