Python Forum
Request for little help (for tree coding lines) - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Request for little help (for tree coding lines) (/thread-31084.html)



Request for little help (for tree coding lines) - new_one - Nov-21-2020

Dear Python programmers,
I am a student of computer science, and am now applying for an online course in data science. In order to do this properly, I have to answer 3 questions. Since I am a complete beginner in Python, I would need your help (I have experience in Java).

I am using this online plattform for Python: https://www.tutorialspoint.com/execute_python_online.php
And I have to answer the following 3 questions:
- what is returned when I evaluate [n for n in range(10) if n % 2]?
- what kind of error is returned by the following code: (e.g. NameError, ValueError, IOError, etc.) def my_func(n1, n2): return n1 + n2 my_func(1, 2, 3)
- What is returned by datetime(1970, 1, 1).strftime('%Y-%d-%B') in Python?

I am trying to use the plattform above (at tutorialspoint), but still am not doing it proper and am not sure how to use it in order to answer these 3 questions. Please help me.
Thank you in advance. Heart


RE: Request for little help (for tree coding lines) - buran - Nov-22-2020

1. If you are not able to solve this yourself, without the need to run the code - maybe this course is not for you. These are really basic stuff and if you are not able to solve - you will probably have hard time following the course. Take a python beginners course as per-requisite for this course.
2. Despite 1, you can run these code snippets/lines and see what you get, right?


RE: Request for little help (for tree coding lines) - ibreeden - Nov-22-2020

Hi,
You should not use https://www.tutorialspoint.com/execute_python_online.php because it is version 2.7.13. Version 2 is deprecated.
On this forum you find in the menu bar: Interpreter. It is Python version 3.2. You had better use that one.
Dit you find the answers to your questions by executing them?