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

 

rmueller@lasacs.com final2020period1 > allAboutStrings
prev  |  next  |  chance

Given a string with at least 3 characters return a list of its

  1) length
  2) first character
  3) last character
  4) middle character if it has an odd number of characters, else middle two characters
  5) index of 2nd occurrence of the 2nd character of the string in the format '@ index #', 'not found' if the 2nd character does not occur again in the string 

allAboutStrings('LASA') → [4, 'L', 'A', 'AS', '@ index 3']
allAboutStrings('Computer') → [8, 'C', 'r', 'pu', 'not found']
allAboutStrings('Science') → [7, 'S', 'e', 'e', '@ index 5']

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

def allAboutStrings(string):

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