Giter Club home page Giter Club logo

thinkcspy's People

Contributors

anharrington avatar barbarer avatar bnmnetp avatar bnmtest avatar bryar-frank avatar campbelle2 avatar christsona avatar commentandconquer avatar constantinol avatar conzty01 avatar diamondyucas avatar dsanders12 avatar ethantmcgee avatar gardhi01 avatar hangde01 avatar haugrud avatar jdeisenberg avatar moisedk avatar natstall avatar psmaker avatar qasema avatar rharder avatar runestonetest avatar sabira1709 avatar schweinsbergs avatar sschaub avatar stevenclontz avatar tim24jones avatar waynebrown avatar wesleywu20 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

thinkcspy's Issues

2 little things

Error reported in course CSC2-140 on page 2DimensionalIterationImageProcessing by user tdelaubenfels [email protected]
Explaining the negative image of the Luther bell, the paragraph refers to newimg while the code use win.
BTW, the input validation while loop in Ch. 8 always gives a times out message. Works great in Idle.

activecode button names

Error reported in course thinkcspy on page SpecialWaystoExecutePythoninthisBook by user drjwsimmons [email protected]
The text says that activecode has Save, Run, and Load buttons, but it actually has Save&Run, Load History, and Show Codelens buttons. The text appears to describe an older version of activecode.

Incorrect Wording of Exercise Answer

Error reported in course CS150Fa16 on page http://interactivepython.org/runestone/static/CS150Sp16/GeneralIntro/FormalandNaturalLanguages.html by user peteli05 [email protected]
The explanation of the answer to Intro-11-1 says "All of these can be present in natural languages, but cannot exist in formal languages." The word "these" refers to "ambiguity, redundancy, and literalness," which together are the correct answer to Intro-11-1. The problem is that, as the textbook has just explained, formal languages MUST be literal. Therefore, it makes no sense to say that literalness "cannot exist in formal languages." The explanation of this answer needs to be reworded to explain that natural languages can be ambiguous and redundant precisely because they are not always literal, whereas formal languages are always literal and therefore are not ambiguous and require less redundancy.

EX20Ch9

Error reported in course thinkcspy on page Exercises by user willwatts4519 [email protected]
The first and last example given are incorrect. My understanding for question 20 on chapter 9 of the examples - is that you should list all characters and remove dups - so oo-> o and pooh -> poh. the examples get rid of duplicates.

Trouble configuring postgres

I'm running into errors trying to self host this with a working database.

I've configured postgres and created a database and user for runestone, and I'm not sure what to do from here.

Here's the error I'm getting when i try runestone build:

Traceback (most recent call last):
  File "/home/ubuntu/.local/bin/runestone", line 7, in <module>
    from runestone.__main__ import main
  File "/home/ubuntu/.local/lib/python2.7/site-packages/runestone/__init__.py", line 1, in <module>
    from .activecode import *
  File "/home/ubuntu/.local/lib/python2.7/site-packages/runestone/activecode/__init__.py", line 1, in <module>
    from .activecode import *
  File "/home/ubuntu/.local/lib/python2.7/site-packages/runestone/activecode/activecode.py", line 26, in <module>
    from runestone.server.componentdb import addQuestionToDB, addHTMLToDB
  File "/home/ubuntu/.local/lib/python2.7/site-packages/runestone/server/componentdb.py", line 30, in <module>
    questions = Table('questions', meta, autoload=True, autoload_with=engine)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/sqlalchemy/sql/schema.py", line 439, in __new__
    metadata._remove_table(name, schema)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/sqlalchemy/sql/schema.py", line 434, in __new__
    table._init(name, metadata, *args, **kw)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/sqlalchemy/sql/schema.py", line 514, in _init
    include_columns, _extend_on=_extend_on)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/sqlalchemy/sql/schema.py", line 527, in _autoload
    _extend_on=_extend_on
  File "/home/ubuntu/.local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2045, in run_callable
    return conn.run_callable(callable_, *args, **kwargs)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1534, in run_callable
    return callable_(self, *args, **kwargs)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 372, in reflecttable
    table, include_columns, exclude_columns, **opts)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/sqlalchemy/engine/reflection.py", line 598, in reflecttable
    table_name, schema, **table.dialect_kwargs):
  File "/home/ubuntu/.local/lib/python2.7/site-packages/sqlalchemy/engine/reflection.py", line 369, in get_columns
    **kw)
  File "<string>", line 2, in get_columns
  File "/home/ubuntu/.local/lib/python2.7/site-packages/sqlalchemy/engine/reflection.py", line 54, in cache
    ret = fn(self, con, *args, **kw)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py", line 2397, in get_columns
    info_cache=kw.get('info_cache'))
  File "<string>", line 2, in get_table_oid
  File "/home/ubuntu/.local/lib/python2.7/site-packages/sqlalchemy/engine/reflection.py", line 54, in cache
    ret = fn(self, con, *args, **kw)
  File "/home/ubuntu/.local/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py", line 2323, in get_table_oid
    raise exc.NoSuchTableError(table_name)
sqlalchemy.exc.NoSuchTableError: questions

Looks like I need to further configure the database, but I can't find a script or guide to do that in any of the repos.

Thanks for the help!

Whack-a-mole image source

Error reported in course thinkcspy on page 11_gui_program_example by user soilNgrass [email protected]
URL for mole.png given in the source code of whack-a-mole game only sent me to a game on Google play store, not the actual image itself.

Instant time limit error

Error reported in course thinkcspy on page SentinelValuesAndValidation by user azt3k [email protected]
Hello,

I'm working through the def checkout() function exercise, and every time I run it, it tells me that the run time has exceeded the time limit allowed right after I submit the user input. I'm wondering if this is either: 1) Part of the problem I'm being tasked with solving, or 2) A bug somewhere in the activecode field? Any and all help will be very much appreciated!

Exercises 10.30

Error reported in course thinkcspy on page Exercises by user ivanmarkchang [email protected]
Exercises 10.30 start on problem 14 instead of 1.

Also, exercise 16 question is missing, but answer is available.

Active Code Window for Ch 17 Exercises are from Ch 16 Exercises

Some of the Ch 17 Exercises seem to fetch the same code from Ch 16 Exercises.

For example, here is a Ch 16 exercise.
image

And here is the same code in a Ch 17 exercise.
image

They both seem to use classes_q3.

There are other overlapping exercises - classes_q5 and classes_q6 in Chapter 17 as well.

getHeight() does not work for a newly made image

Not sure if this is the right place for this issue...

In Ch 8, getHeight() for an image created by image.Image() works, but getHeight() for an image created by image.EmptyImage() doesn't seem to work.

image

Incorrect link

Error reported in course usafa_cs210_2016 on page StringMethods by user waynebrown [email protected]
The link to the Python documentation for strings goes to the wrong place in the documentation. The exact text is: "You can also consult the Python documentation for strings."

Save & RunLoad HistoryShow CodeLens

The current link is: https://docs.python.org/3/library/stdtypes.html#index-21

The link should be: https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str
or https://docs.python.org/3/library/stdtypes.html#string-methods

Thanks

Testbug

This report is to test a new github API supported report a bug page. Please ignore.

Running as standalone - pavement.py serving_dir

Hi there,

Steps:

  • Cloning thinkcspy onto Kubuntu 14.04
  • Running the instructions in README.rst

Unexpected result:

File "/usr/local/lib/python2.7/dist-packages/runestone/__main__.py", line 83, in serve
  os.chdir(pavement.serving_dir)
AttributeError: 'module' object has no attribute 'serving_dir'

Temporary fix:

Add

serving_dir = "./build/"+project_name

at line 25 of pavement.py.

Thanks,

Remove the splash page from this book and make it consistent with all the others.

Having this as a splash page is a hold-over from the early days of Runestone.

  • move contents of toc.rst back to index.rst
  • fix the build logic in scheduler.py (in RunestoneServer) so it does not special case this book anymore
  • fix the build logic in runestone build to not special case this book
  • fix the logic in designer.py to not make a copy
  • update instructor interface so now we only need one link to edit a toc for any book

Question is wrong

Error reported in course thinkcspy on page functions by user MilesConn [email protected]
The question in 6-1, the answer to one of a questions is that a function is a named order of sequences. This isn't entirely true as lambda is an unnamed function.

Build issues

I'm attempting to build thinkcspy on my local machine (Mac running 10.12), and continue to bump into an error. My setup was as follows:

  • brew install python3
  • pip3 install virtualenv
  • pip3 install virtualenvwrapper
  • pip3 install -r requirements.txt
  • runestone build

On the build step, I get the following error:

/Users/dan/PythonEnvProjects/thinkcspy/_sources/assignments.rst:2: WARNING: Field list ends without a blank line; unexpected unindent.
WARNING: /Users/dan/PythonEnvProjects/thinkcspy/_sources/index.rst:29: (SEVERE/4) Unexpected section title.

About this Project
------------------
looking for now-outdated files... none found
pickling environment... done
checking consistency... /Users/dan/PythonEnvProjects/thinkcspy/_sources/Functions/ProgrammingWithStyle.rst: WARNING: document isn't included in any toctree
/Users/dan/PythonEnvProjects/thinkcspy/_sources/GUIandEventDrivenProgramming/12_model_view_controller.rst: WARNING: document isn't included in any toctree
done
preparing documents... done
writing output... [  0%] Appendices/errorsAndDebug                                                                      
Exception occurred:
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/sphinx/util/osutil.py", line 61, in relative_uri
    if to.startswith(SEP):
jinja2.exceptions.UndefinedError: 'str object' has no attribute 'filename'
The full traceback has been saved in /var/folders/vs/zntd66n50v5_b7x8wp5ln9b00000gn/T/sphinx-err-g83uz0yq.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
trying alternative database access due to  No module named 'dal'
You need to install a DBAPI module - psycopg2 for Postgres
Creating Chapter Information for ./_sources/index.rst
Error in building thinkcspy

The log file referenced above gives the following:

# Python version: 3.6.0 (CPython)
# Docutils version: 0.13.1 release
# Jinja2 version: 2.9.6
# Last messages:
#   checking consistency...
#   
#   done
#   
#   preparing documents...
#   
#   done
#   
#   writing output... [  0%] Appendices/errorsAndDebug
#   
# Loaded extensions:
#   alabaster (0.7.10) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/alabaster/__init__.py
#   sphinx.ext.mathjax (1.6.1) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/sphinx/ext/mathjax.py
#   runestone.activecode (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/activecode/__init__.py
#   runestone.animation (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/animation/__init__.py
#   runestone.assess (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/assess/__init__.py
#   runestone.assignment (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/assignment/__init__.py
#   runestone.blockly (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/blockly/__init__.py
#   runestone.clickableArea (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/clickableArea/__init__.py
#   runestone.codelens (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/codelens/__init__.py
#   runestone.datafile (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/datafile/__init__.py
#   runestone.disqus (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/disqus/__init__.py
#   runestone.dragndrop (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/dragndrop/__init__.py
#   runestone.external (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/external/__init__.py
#   runestone.fitb (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/fitb/__init__.py
#   runestone.livecode (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/livecode/__init__.py
#   runestone.meta (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/meta/__init__.py
#   runestone.parsons (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/parsons/__init__.py
#   runestone.poll (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/poll/__init__.py
#   runestone.question (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/question/__init__.py
#   runestone.reveal (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/reveal/__init__.py
#   runestone.shortanswer (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/shortanswer/__init__.py
#   runestone.tabbedStuff (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/tabbedStuff/__init__.py
#   runestone.usageAssignment (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/usageAssignment/__init__.py
#   runestone.video (unknown version) from /Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/runestone/video/__init__.py
Traceback (most recent call last):
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/sphinx/cmdline.py", line 306, in main
    app.build(opts.force_all, filenames)
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/sphinx/application.py", line 338, in build
    self.builder.build_update()
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 328, in build_update
    'out of date' % len(to_build))
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 394, in build
    self.write(docnames, list(updated_docnames), method)
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 431, in write
    self._write_serial(sorted(docnames))
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 440, in _write_serial
    self.write_doc(docname, doctree)
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/sphinx/builders/html.py", line 556, in write_doc
    self.handle_page(docname, ctx, event_arg=doctree)
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/sphinx/builders/html.py", line 940, in handle_page
    output = self.templates.render(templatename, ctx)
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/sphinx/jinja2glue.py", line 176, in render
    return self.environment.get_template(template).render(context)
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 76, in render
    return original_render(self, *args, **kwargs)
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/sphinx/themes/basic/page.html", line 10, in top-level template code
    {%- extends "layout.html" %}
  File "/Users/dan/PythonEnvProjects/thinkcspy/_sources/_templates/plugin_layouts/sphinx_bootstrap/layout.html", line 203, in top-level template code
    <li>{% include "sourcelink.html" %}</li>
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/sphinx/themes/basic/../basic/layout.html", line 128, in top-level template code
    {%- block csss %}
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/sphinx/themes/basic/../basic/layout.html", line 129, in block "csss"
    {{ css() }}
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/jinja2/sandbox.py", line 427, in call
    return __context.call(__obj, *args, **kwargs)
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/jinja2/runtime.py", line 553, in _invoke
    rv = self._func(*arguments)
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/sphinx/themes/basic/../basic/layout.html", line 109, in template
    <link rel="{{ css.rel }}" href="{{ pathto(css.filename, 1) }}" type="text/css"{% if css.title is not none %} title="{{ css.title }}"{% endif %} />
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/jinja2/sandbox.py", line 427, in call
    return __context.call(__obj, *args, **kwargs)
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/sphinx/builders/html.py", line 912, in pathto
    uri = relative_uri(baseuri, otheruri) or '#'
  File "/Users/dan/Envs/thinkcspy/lib/python3.6/site-packages/sphinx/util/osutil.py", line 61, in relative_uri
    if to.startswith(SEP):
jinja2.exceptions.UndefinedError: 'str object' has no attribute 'filename'```

I've tried a number of things, including setting everything up on python2 instead of python3, but I run into similar problems. Any suggestions?

activecode exercises need to be updated with text in the content

Now that more people are using the interface to build assignments, it is very problematic that the exercises were written with the question outside the directive. This means that when you add an exercise to an assignment all you get is the codemirror box and any sample code. But you can't see what you are supposed to do! The solution is simply to move the explanation inside the directive.

.. actex:: foo
   :options heree:

   The question text should go here followed by 4 ~
   ~~~~
   sample code if any
   ====
   hidden code
  • GeneralIntro
  • SimplePythonData
  • Debugging
  • PythonTurtle
  • PythonModules
  • Functions
  • Selection
  • MoreAboutIteration
  • Strings
  • Lists
  • Files
  • Dictionaries
  • Exceptions
  • GUIandEventDrivenProgramming
  • IntroRecursion
  • ClassesBasics
  • ClassesDiggingDeeper
  • Labs

Answer for turtle6.6

Greetings 😄

Thanks for creating such an amazing resource.

The answer for turtle 6.6 seems incorrect. The present answer is 'c'.

screen shot 2016-06-07 at 12 34 52 pm

Option 'a' seems the correct one as the turtle is drawing the complete square and in a single color only.

Not introduced what is a variable

Error reported in course thinkcspy on page ValuesandDataTypes by user vader [email protected]
You used the variable "message" but did not explain that this is a variable. It is quite easy to induct this - almost subconscious - but some people might need an explanation.

User: vader

Wrong meaning

Error reported in course thinkcspy on page ValuesandDataTypes by user vader [email protected]
"When we show the value of a string using the print function, such as in the third example above, the quotes are no longer present."
In fact, they are present. When removed, the interpreter thinks that the two words are two values.
I think there is a mistake in the sentences' "semantics", :).

duplicate ids

The first activecode in the Functions chapter and the first activecode on the Using a Main Function are both named ch04_1
This causes problems with scheduling assignments

Result typo?

Error reported in course thinkcspy on page Exercises by user solid [email protected]
The below exercise has a result of 344. The sum of squares should be 365.

Result  Actual Value    Expected Value  Notes
Pass    29  29  Tested sum_of_squares on input [2,3,4]
Pass    2   2   Tested sum_of_squares on input [0,1,-1]
Fail    365 344 Tested sum_of_squares on input [5,12,14]

You passed: 66.6666666667% of the tests

(ex_7_11)

No page navigation

Error reported in course S18-SH01C on page index by user shankd2567@clarkstate,edu [email protected]
I only have the Chapters list in the navigation tool bar. There are not any other navigation tools like pages. There is also not any way to tell when you are on a page where you are in the text.

Ch 2.8 Question Wording

In Chapter 2.8 Input of How To Think Like a Computer Scientist there is a question "Click on all of the variables of type int in the code below".

This question uses an undefined variable total_secs.
Since the variable is undefined, one can not know if it is of type int or not.

I believe the question should be rewritten as:

seconds = input("Please enter the number of seconds you wish to convert")
total_secs = int(seconds)  # <--  This is a new line
hours = int(seconds) // 3600
secs_still_remaining = total_secs % 3600
print(secs_still_remaining)

The same problem exists with the subsequent question.
Here are the questions:
image

Setting turtle up() is in the wrong location.

Error reported in course thinkcspy on page montepi by user apa [email protected]
Under the throwing darts section.

fred.up() is currently initialized right after the instantiation of turtle.Turtle().

However this results in the turtle still leaving a line. What needs to happen is fred.up() called after the window has been instantiated.

I've tested the above and it no longer leaves a line.

Check your understanding box is not active only in this page URL below

Error reported in course thinkcspy on page ThePythonProgrammingLanguage
My Username: JosephHamam
My Email: [email protected]
Java console:
rangy-core.js:10 Discontiguous selection is not supported.(anonymous function) @ rangy-core.js:10
jquery.js:5 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
rangy-core.js:10 Uncaught TypeError: Failed to execute 'selectNodeContents' on 'Range': parameter 1 is not of type 'Node'.
capture.js:56 Check Link: filename = thepythonprogramminglanguage.html, ext = .html

Content Error?

Error reported in course thinkcspy on page https://runestone.academy/runestone/static/thinkcspy/SimplePythonData/Input.html by user MiraclesHappen [email protected]
In the last exercise (2.8 Input)
Click on all of the variables of type str in the code below:

seconds = input("Please enter the number of seconds you wish to convert")
hours = int(seconds) // 3600
secs_still_remaining = total_secs % 3600
print(secs_still_remaining)

As far as I understand there are only 2 strings:
One is the input by the user which is stored in the variable called "seconds". The same variable is then used again to be converted into an integer and divided (//) by 3600. At this stage there are no other strings because the only string in the input has been converted into an integer.
But then we find a variable called "total_secs" which seems to come out of the blue. I am no expert but I'm pretty sure there is a problem here!

Content Error?

Error reported in course thinkcspy on page lab04_01 by user MiraclesHappen [email protected]
In the first exercise we are supposed to draw a circle with a turtle but the exercise starts with:
def drawSquare(t, sz):
"""Make turtle t draw a square of sz."""
We haven't studied how to do that yet. I mean I don't know how to use the "def" function.
I hope this is helpful to improve the flow of your content. To do the exercise, I just got rid of the first part and added the rest with the items we have studied so far.
Thank you!

SyntaxError: bad input on line - Exercises: ex_5_7, ex_5_8, ex_5_13 and ex_5_14

SyntaxError: bad input on line ???
For section: 6 - Functions
Exercises: ex_5_7, ex_5_8, ex_5_13 and ex_5_14

The commonality of these four examples can be seen by looking at the rst file for the functions examples.

These four all have

====
from unittest.gui import TestCaseGui

Once the error occurs for one of these examples I have found no way to resolve it. Clearing the box and inserting new code does not work and changing browsers does not resolve the problem.

However for exercise ex_6_3 I noticed that the indentation for my code started in column 2 instead of column 1 and by adjusting the start of the code I now receive error:

IndentationError: unindent does not match any outer indentation level on line 15
 from unittest.gui import TestCaseGui

 ^

The code visible on the screen ends on line 13 and the error is on line 15.

Related issue

After seeing the reply found the root cause explained in detail in issue 61

Resolution

As noted in the reply the fix is to login as the course instructor, go to the instructors page and select Rebuild

Versions

My versions:
Microsoft Windows 10.0.15063
Microsoft Edge 40.15063.0.0
Microsoft EdgeHTML 15.15063

Course name (which is a copy of thinkcspy) : solebury_2017_fall

Similar exercises

While I have not checked the following examples, they also have the same pattern in the rst file.

recursion
ex_rec_1
ex_rec_2

lists
ex_7_11
ex_9_6
ex_9_7
ex_9_8
ex_9_10
ex_9_13

moreiter
ex_7_9

selection
ex_6_3
ex_6_6
ex_6_7
ex_6_8
ex_6_9
ex_6_10
ex_6_11
ex_6_12

strings
ex_7_10
ex_8_5
ex_8_6
ex_8_7
ex_8_8
ex_8_9
ex_8_10
ex_8_11
ex_8_19

Little exercise issues

Error reported in course CSC2-140 on page Variablesandparametersarelocal by user tdelaubenfels [email protected]
func 3_1 doesn't display anything other than a green stripe after answer.
The answer to func 4_1 doesn't match the source code (initialize isn't in the loop)

ex_5_8

This problem seems to have an indentation weirdness.

image

Looking at the Edit source page, there are only 3 spaces in the yellow area and 4 spaces in the pink.

image

Practice division error

Error reported in course thinkcspy on page OperatorsandOperands
My Username: anonymous
My Email: [email protected]

Hi in the "Operators and Operands" section there is a flaw in the questions. for the 1st question, you ask for the output of print(18/4). The correct answer should be 4 as both 18 and 4 are both integers, and when executed, an integer operation is executed. I even ran it in my python environment and received to answer 4. Now, if you asked to print(18.0/4) or print(18/4.0) or print (18./4), then you get the answer 4.5. However, this is not what you asked.

CH 1.8 Runtime Errors: Question intro-8-2. Possible wording change

I believe the wording of the answer to question intro-8-2 in Chapter 1.8 Runtime Errors of How to Think Like a Computer Scientist could be improved.

The question is Who or what typically finds runtime errors?

The expected answer is The compiler/interpreter.

I would like to see the answer changed to be The interpreter.
It is my view that a compiler finds compile-time errors, not run time errors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.