Python noob having a little trouble with strings

randyliu17 at gmail.com randyliu17 at gmail.com
Thu Oct 26 22:59:10 EDT 2017


On Thursday, October 26, 2017 at 7:41:10 PM UTC-7, boB Stepp wrote:
> On Thu, Oct 26, 2017 at 9:25 PM,  <randyliu17 at gmail.com> wrote:
> > If s1 = "Welcome students", what is the output when you print the following:
> >
> > 1. s4 = 3 * s1
> >
> > 2. s1[3 : 6]
> >
> > 3. 'W' in s1
> >
> > 4. S1[-1]
> >
> > 5. S1[:-1]
> >
> > Any help would be great, thanks!
> 
> Why not find out for yourself and print these in the Python
> interpreter?  For instance:
> 
> > py
> Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:57:36) [MSC v.1900 64
> bit (AMD64)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> py3: s1 = "Welcome students"
> py3: s4 = 3 * s1
> py3: print(s4)
> Welcome studentsWelcome studentsWelcome students
> 
> 
> 
> -- 
> boB

Hi Bob, thanks for responding. I'm not sure where to do so, my professor had us download Pycharm for mac's which uses python 2.6



More information about the Python-list mailing list