Python quiz/test grading, Assistance Needed

This is the place for queries that don't fit in any of the other categories.

Python quiz/test grading, Assistance Needed

Postby Wretch11 » Sat Jun 29, 2013 12:26 am

I'm currently following a computer science course online. I'm not officially signed up for the class though, instead, i'm working through the posted material on my own, as best I can.

The course provides quizzes via downloadable worksheets which enlisted students can send in to have graded. Now since i'm not enlisted, the option to have my work graded is not available to me. As such, I thought i'd try to find some proficient people to grade the work for me.

I'll be posting my completed work here in hopes that someone comes along and offers assistance.

Thanks in advance for your time and help.
Wretch11
 
Posts: 3
Joined: Fri Jun 28, 2013 11:00 pm

Re: Python quiz/test grading, Assistance Needed

Postby metulburr » Sat Jun 29, 2013 12:34 am

Now since i'm not enlisted, the option to have my work graded is not available to me. As such, I thought i'd try to find some proficient people to grade the work for me.

I dont think anyone here is going to play professor. But if you post your code we can give you tips, etc.
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1470
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: Python quiz/test grading, Assistance Needed

Postby Wretch11 » Sat Jun 29, 2013 12:45 am

I've attached my first quiz if anyone wants to take a look

I dont think anyone here is going to play professor. But if you post your code we can give you tips, etc.


Noted and thanks

I figured i'll just try anyway and see if I get someone willing to help (unless there's any objections). I'm mostly looking to know if my answers are correct or incorrect and if the later, why.

Also, just a note: I've tried simply copy/pasting the text in my rtf file to the post window, but doing so brings up an SQL error, so I just attached the whole rtf (hope this is ok, if not ill remove it right away)
Attachments
review 1.1.rtf
(5.88 KiB) Downloaded 43 times
Wretch11
 
Posts: 3
Joined: Fri Jun 28, 2013 11:00 pm

Re: Python quiz/test grading, Assistance Needed

Postby metulburr » Sat Jun 29, 2013 12:56 am

triple quotes are not comments, it is a triple quoted string
It could be used as:
Code: Select all
s = '''a 'single quote' and a "double quote"'''
print(s)

will output:
a 'single quote' and a "double quote"


Code: Select all
2/3

will output 2 different things in python3.x and python2.x, unless in 2.x you import from __future__ division: In python2.x floor division is default, in python3.x floor division operator is //
Code: Select all
metulburr@ubuntu:~$ python
Python 2.7.4 (default, Apr 19 2013, 18:28:01)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 5/2
2
>>> 5.0/2
2.5
>>> from __future__ import division
>>> 5/2
2.5
>>> exit()
metulburr@ubuntu:~$ python3
Python 3.3.1 (default, Apr 17 2013, 22:30:32)
[GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 5/2
2.5
>>> 5//2
2
>>>


Apple and APPLE can both be used as variable names, although it is preferred to save capped vars for classes. In fact all capped vars are known to be global

I didnt read it all though. But most of this stuff you can figure out by using the interpreter.
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1470
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: Python quiz/test grading, Assistance Needed

Postby Wretch11 » Sat Jun 29, 2013 1:13 am

Noted your feedback and made the appropriate corrections. Thanks for that, much appreciated :)

If someone is willing and has a moment, id appreciate some feedback on questions 9 through 13 (The explain the mistakes questions)
Wretch11
 
Posts: 3
Joined: Fri Jun 28, 2013 11:00 pm

Re: Python quiz/test grading, Assistance Needed

Postby micseydel » Wed Jul 03, 2013 4:42 am

I believe you're alright for 9-13, but for 14, if I were grading the exam, I'd make the distinction between ints and floats. For lines <80 characters, when you're not doing error handling or anything, to just do the conversion from string to number on the same line. In real code, you don't define pi yourself, you just import it from math. The variable n in the following code is unnecessary
Code: Select all
n = input("Enter the number of moles:" )
n = float(n)
moles_of_gas = n

just do
Code: Select all
moles = float(input("Enter the number of moles:" ))

"moles_of_gas" is alright too, but I think "moles" is succinct.

In the future, I'd happily help with "grading" tests like this, just be aware that you'd get feedback from us on our own time so it could take a while. I'd say you can bump up to two times, 48 hours apart (though I usually get back to posts faster than that). But, as metulburr said, you shouldn't ask us questions that the interpreter can answer, like what is a valid variable name, what 2/3 and 2//3 evaluate to, or anything like that.
Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.
User avatar
micseydel
 
Posts: 1368
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA


Return to General Coding Help

Who is online

Users browsing this forum: physicist and 2 guests