Python noob having a little trouble with strings

Naman Bhalla dev at namanbhalla.in
Fri Oct 27 12:16:22 EDT 2017


I guess your professor just asked you to download Pycharm. It is just MacOS that happens to have Python 2.6 inbuilt. Had your professor actually wanted you to be using Python 2 (I doubt), that would have been 2.7. Regardless of that I recommend having latest Python 2 or 3 as per your requirements, from python.org. 
In Pycharm, you can access Python Console from bottom right (Make sure you select correct version of Python in your project settings.) Or in MacOS, just type python and then type commands and check for yourself.
BTW, You can know more about what you are going to test here:- https://docs.python.org/3/tutorial/introduction.html#strings

Regards.

On 27/10/17, 08:33, "python-list-bounces+dev=namanbhalla.in at python.org on behalf of randyliu17 at gmail.com" <python-list-bounces+dev=namanbhalla.in at python.org on behalf of randyliu17 at gmail.com> wrote:

    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
    -- 
    https://mail.python.org/mailman/listinfo/python-list
    





More information about the Python-list mailing list