0

I'm just starting cs50's week 6 in python. I copied a small program written by David in the lecture to run in my cs50 IDE, but I'm getting a strange error. I believe the error is about the get_string function declared from the cs50 library, but I'm not sure. Here is my (well, David's) code, and a screenshot of the error. Any help would be appreciated!

enter image description here

from cs50 import get_string

# Get a string
s = get_string("s: ")

# Copy string
t = s

# Capitalize copy
t = t.capitalize()

# Print strings
print(f"s: {s}")
print(f"t: {t}")
7
  • seems like it can't import get_string from cs50, try using s = input("s: ") instead
    – Ojou Nii
    Jun 16, 2020 at 19:30
  • Do you happen to have a file named cs50.py in in lecture6 directory? Jun 16, 2020 at 20:14
  • @DinoCoderSaurus No, I named the file copystring.py
    – Nick
    Jun 16, 2020 at 20:25
  • Does any file exist in that directory named cs50.py? Jun 16, 2020 at 20:28
  • @DinoCoderSaurus No, just copystring.py, string.py, and cough.py
    – Nick
    Jun 16, 2020 at 20:31

0

You must log in to answer this question.

Browse other questions tagged .