Python for Beginners [10 of 44] Demo: Strings

Play Python for Beginners [10 of 44] Demo: Strings
Sign in to queue

Description

Demo: Working with strings in code

Full 'Intro to Python' course on Microsoft Learn: https://aka.ms/MSLearnPython

Sample code: https://aka.ms/PythonGettingStarted
Watch the entire series: https://aka.ms/PythonBeginnerSeries

Tag:

Python

Embed

Download

The Discussion

  • User profile image
    Daniel

    Hello Christopher and Susan,

    Great course so far, however, I am having issues with the input function, and I can't find similar cases online to help fix it. I have been using Visual Studio Code for this course, but I have done a little bit of data analysis in python at uni using the Anaconda distribution and Spyder as IDE. The input doesn't work in visual studio code, but if I type the same code in Spyder it does work. It seems like a problem with Visual Studio, is it something you can help with?

    Error message:
    Please enter your first name: Daniel
    Traceback (most recent call last):
    File "strings.py", line 6, in <module>
    first_name = input("Please enter your first name: ")
    File "<string>", line 1, in <module>
    NameError: name 'Daniel' is not defined

  • User profile image
    gtaboy34
    @Daniel:
    post your code, it will help to see what is there *specially at line 6

Add Your 2 Cents