Skip to main content
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Python3, 38 36 bytes

def f(s,i):return s+'\n'+' '*~-i+'^' # OR def f(s,i):print(s+'\n'+' '*~-i+'^') 

Test it here
Thanks to @Dennis@Dennis for saving 2 bytes!

Python3, 38 36 bytes

def f(s,i):return s+'\n'+' '*~-i+'^' # OR def f(s,i):print(s+'\n'+' '*~-i+'^') 

Test it here
Thanks to @Dennis for saving 2 bytes!

Python3, 38 36 bytes

def f(s,i):return s+'\n'+' '*~-i+'^' # OR def f(s,i):print(s+'\n'+' '*~-i+'^') 

Test it here
Thanks to @Dennis for saving 2 bytes!

added 49 characters in body
Source Link
Spikatrix
  • 1.9k
  • 1
  • 17
  • 33

Python3, 3838 36 bytes

def f(s,i):return s+'\n'+' '*(i'*~-1)+'^'i+'^' # OR def f(s,i):print(s+'\n'+' '*(i'*~-1)+'^'i+'^') 

Test it here
Thanks to @Dennis for saving 2 bytes!

Python3, 38 bytes

def f(s,i):return s+'\n'+' '*(i-1)+'^' # OR def f(s,i):print(s+'\n'+' '*(i-1)+'^') 

Test it here

Python3, 38 36 bytes

def f(s,i):return s+'\n'+' '*~-i+'^' # OR def f(s,i):print(s+'\n'+' '*~-i+'^') 

Test it here
Thanks to @Dennis for saving 2 bytes!

Python comments start with `#` , not `/*...*/` or `//` . Silly me! :-)
Source Link
Spikatrix
  • 1.9k
  • 1
  • 17
  • 33

Python3, 38 bytes

def f(s,i):return s+'\n'+' '*(i-1)+'^' /*# OR */ def f(s,i):print(s+'\n'+' '*(i-1)+'^') 

Test it here

Python3, 38 bytes

def f(s,i):return s+'\n'+' '*(i-1)+'^' /* OR */ def f(s,i):print(s+'\n'+' '*(i-1)+'^') 

Test it here

Python3, 38 bytes

def f(s,i):return s+'\n'+' '*(i-1)+'^' # OR def f(s,i):print(s+'\n'+' '*(i-1)+'^') 

Test it here

Source Link
Spikatrix
  • 1.9k
  • 1
  • 17
  • 33
Loading