troubleshooting Question

Why its dont work?

Avatar of Ari Abdrakhmanov
Ari Abdrakhmanov asked on
Operating SystemsInstallationPython
3 Comments1 Solution277 ViewsLast Modified:
Hello! I am a python beginner. I write a code, with pyowm module (Pyowm on github: https://github.com/csparpa/pyowm), but its for some reason wrong. I has download the pyowm module and I using the terminal for module installation on python 3. My os is Mac OS X Yosemite and the my python version is 3.6.3. I even use Sublime Text 3 as a code editor. What I do wrong? Please help me!
My code:
   
    import pyowm
   
    city = input('Write a city for weather analysis:')
   
    owm = pyowm.OWM('5f28df836a35fc458e6270eb8f01ec86')
    observation = own.weather_at_place(city)
    w = observation.get_weather()
    temperature = w.get_temperature('celsius')['temp']
   
    print("The temperature in" + city + "is: " + str(temperature) + "on celsius")

But python say:

Traceback (most recent call last):
  File "untitled.py", line 3, in <module>
    city = input('Write a city for weather analysis:')
  File "<string>", line 1, in <module>
NameError: name 'London' is not defined
SBSC02PBB8G9402:pythonpractice dchim$ python untitled.py
Write a city for weather analysis: London
Traceback (most recent call last):
  File "untitled.py", line 3, in <module>
    city = input(str('Write a city for weather analysis:'))
  File "<string>", line 1, in <module>
NameError: name 'London' is not defined.


Thanks!!!
untitled.py
ASKER CERTIFIED SOLUTION
pepr

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros