id/email
password
forgot password | create account
about | help | prefs
ReadingBatcode reading practice

 

 

String Operationsslice3

prev  |  next  |  chance

The first character in a string is at index 0.

def slice3(s):
    length = len(s)
    mid = int(length / 2)
    c = s[mid]
    return c
Function Call  Return Value
slice3('Car')
slice3('Truck')
slice3('556843')
slice3('Elephant')
slice3('Roses')

Experiment with this code on Gitpod.io

⬅ Back