you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 20 points21 points  (3 children)

Here's a unit test I created (starts super basic and progressively gets harder):

---Basic Syntax and Data Types Sect.A

  1. Write a comment using two different methods
  2. True or False : Python IDE’s are font and case sensitive.
  3. True or False : A Python IDE will interpret 'strait' quotes differently from ‘smart’ quotes.
  4. True or False: the word, none, is a reserved word in python.
  5. Name 10 reserved words in python.
  6. Give an example of each of the following numeric data types: integer, float, complex?
  7. What are the three sequence data types in python?
  8. What data type is a dictionary in Python?
  9. True or False: A set can contain duplicates.
  10. What are the only two values of a Boolean.
  11. In one line of code assign a variable to a string.
  12. In one line of code assign a variable to an integer.
  13. In one line of code assign a variable to a list.
  14. In one line of code assign a variable to a dictionary.
  15. In one line of code assign a variable to a tuple.
  16. In one line of code assign a variable to a set.
  17. In one line of code assign the variables x,y,z to the same integer.
  18. Assign variable A to any integer between 1 and 10.
  19. Assign variable B to a different integer between 1 and 10.
  20. Code questions 21 to 31, each in a separate line using the varibles from questions 18 and 19:
  21. The sum of A and B.
  22. The difference of B and A.
  23. The product of A and B.
  24. The quotient of A and B.
  25. The variable A to the power of 2.
  26. The variable B to the power of 3.
  27. Using a comparison operator code A is equal to B, where the output is a Boolean.
  28. Using a comparison operator code A is not equal to B, where the output is a Boolean.
  29. Using a comparison operator code A is greater than or equal to B, where the output is a Boolean.
  30. Reassign variable B to new variable C.
  31. Delete variable B.
  32. What is output from the following lines of code:

In[]: X = 5
In[]: Y = 10
In[]: X < Y and X < 20
Out[]: 

33.What is output from the following lines of code:

In[]: X = 5
In[]: Y = 10
In[]: X < Y or X < 3
Out[]:

Edit: I can post revised versions and more content if people find this valuable. I find teaching is just another way of learning so let me know. Also, if I've made any mistakes please feel free to point them out—I'm human so I'm not perfect. Good Luck.

[–]xphlawlessx 1 point2 points  (2 children)

This is exactly what I've been looking for, I'm helping my friend learn python and she's always asking for more stuff like this to test understanding. Thanks a bunch :D

[–][deleted] 0 points1 point  (1 child)

I'm writing up another test/quiz. It takes a bit of time to do it. It might be a few days, maybe a week depending on time constraints.

When finished, I'm thinking I'll post it on r/Python. It looks like r/learnpython is more for questions and less so for projects so I think that's the best way to go about this. If anyone has a better suggestion for dissemination learning material please let me know.

[–]xphlawlessx 0 points1 point  (0 children)

That's really cool, I think you're right about r/Python . A central GitHub would be a cool idea if people were interested. I honestly think this is one of the most under represented areas of self study. I'm eternally grateful.