Python Online Testing
Test IT skills

Python & Django Test

Total 40 Questions, Maximum 80 Minutes, For Mid Level Developers

Online test includes:

Python  -  20 Questions

  • Python Object-Oriented Programming (OOP)
  • Namespaces, Scope and Names binding
  • Python Constructs (Generators, Iterators, Decorators, Lambda)
  • Syntax and Stdlib

Django  -  20 Questions

  • Forms
  • Views
  • Models / Django ORM
  • Authentication / Authorization

Sample Question

User's last_name is not set to 'foo', remains unchanged. How would you solve the problem?

user = User.objects.filter(id=123)
user[0].last_name = 'foo'
user[0].save()

 

a)  user = User.objects.filter(id=123)
      if user:
          user[0].last_name = 'foo'
          user[0].save()
        
b)  user = User.objects.get(id=123)
      user.last_name = 'foo'
      user.save()
 
c)  user = User.objects.filter(id=123)[0]
     user.last_name = 'foo'
     user.save()
 
d)  All of the above