id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

burns@bxscience.edu burnscfa > iPower
prev  |  next  |  chance

Complete the function which will calculate the powers of i, the imaginary operator. Example: i^power -> i^3 = "-i". The answer should be expressed in terms of a String. Power is an integer.


iPower(0) → '1'
iPower(1) → 'i'
iPower(2) → '-1'

...Save, Compile, Run (ctrl-enter)

def iPower(power):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 100

Copyright Nick Parlante 2017 - privacy