• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

Code won't work in HackerRank but will in Visual Studio Code

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey y'all! First time posting in Code Ranch  I am trying to figure out the following problem on HackerRank:
https://www.hackerrank.com/challenges/python-lists/problem

I wrote my code in visual studio code -- Using the examples provided by the problem, the correct output seems to be coming out out of the vs console.

However, when I paste my solution into HR and click submit it says there's a syntax problem with line 7, the args line.

Does anyone know why this is happening? Thanks in advance!

 
Rancher
Posts: 924
22
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Liz,

i've looked over your code and i do not see the error, that does not mean there is not one, but i am a Microsoft VS programmer also.  What i have found over the years is that MS has a tendency so superset the instruction set for a language--that was the crux of the Sun VS Microsoft legal action over Java years ago.  i would suggest you to back to the standard reference, and not MS's docs, and look over the syntax of the instructions you use.  there may be a surprise hidden within.  if not then i am just showing my extreme bios against the software giant.

Les
 
Liz Alexander
Greenhorn
Posts: 2
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Les, thank you for your response! I found out I was making a terribly stupid mistake and was using PyPy2 instead of Python3 on HackerRank. Facepalm.


I'm a coding beginner so unfortunately, the majority of your suggestion went over my head haha. Though, I will google certain terms and see if I can make sense of it and try to learn from it. Thanks again!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic