.. This file is part of the OpenDSA eTextbook project. See
.. http://opendsa.org for more details.
.. Copyright (c) 2012-2020 by the OpenDSA Project Contributors, and
.. distributed under an MIT open source license.

.. avmetadata::
   :author: Hamza Manzoor
   :requires:
   :satisfies: Python Basics
   :topic: Parsons Python


jsParsons Python 2
==================

About
-----------------------

Parson's problems in Python.

ps_python_iteration_multiplication
-------------------------------------
Construct a program that multiples number with 2 in a loop and prints values 1,2,4,8 and finally prints "The end!".

.. extrtoolembed:: 'ps_python_iteration_multiplication'
   :learning_tool: mastery-grid-jsparsons-python

ps_python_calculate_function
-------------------------------
Define a function that returns the second value multi- plied by two and added by the first value. The program should print 23 at the end.

.. extrtoolembed:: 'ps_python_calculate_function'
   :learning_tool: mastery-grid-jsparsons-python

ps_python_nested_calls
-----------------------
Define a calculate function and a double function which will return the double of the input value. Then construct a program that first prints out 20 and then 36.

.. extrtoolembed:: 'ps_python_nested_calls'
   :learning_tool: mastery-grid-jsparsons-python

ps_python_recursive_factorial
--------------------------------
Define a recursive function that returns the factorial of a given positive integer.

.. extrtoolembed:: 'ps_python_recursive_factorial'
   :learning_tool: mastery-grid-jsparsons-python

ps_python_class_person
---------------------------------
Write a program that defines a class "Person" and prints out "Safiira. Nice to meet you!"

.. extrtoolembed:: 'ps_python_class_person'
   :learning_tool: mastery-grid-jsparsons-python

ps_python_modulo_is_even
-------------------------------------
Construct a function that will return True if a given number is even, otherwise false.

.. extrtoolembed:: 'ps_python_modulo_is_even'
   :learning_tool: mastery-grid-jsparsons-python


