GE8151-Unit 2- DATA, EXPRESSIONS, STATEMENTS

30 flashcards · Programming Languages · by Joel Anandraj

  1. Define Python.

    Python is an interpreted, high-level, general-purpose programming language.

  2. What is high level language ?

    A high-level language is a programming language like C, Python that enables a programmer to write programs that are more or less independent of a particular type of computer.

  3. What is low level language ?

    A low-level language is a type of programming language that contains basic instructions recognized by a computer.

  4. What is the purpose of interpreter ?

    To convert high level language into low level language.

  5. In general, what are the two kinds of programs that converts high level language into low level language.

    Interpreter Compiler

  6. What is the difference between compiler and interpreter ?

    Compiler converts the whole program in one go on the other hand Interpreter converts the program by taking a single line at a time.

  7. What are the two modes in which python interpreter operates ?

    Normal Mode Interactive Mode

  8. What is Normal Mode ?

    The normal mode is the mode where the scripted and finished .py files are run in the Python interpreter.

  9. What is interactive mode ?

    Interactive mode is a command line shell which gives immediate feedback for each statement given in the shell.

  10. What are the limitation of Interactive mode ?

    Programs we type in the interactive mode goes away as soon as the Python interpreter executes them. The code you type interactively is never stored in a file, so you can't run it again without retyping it from scratch.

  11. Define Value.

    A value is one of the basic things a program works with, like a letter or a number. Example : 2, 42.0, and 'Hello, World!'

  12. What is data type ?

    A data type specifies the nature of a data. Integers belong to the type int, strings belong to str, and floating point numbers belong to float.

  13. What are the datatypes available in python ?

    Some of the most frequently used datatypes are int float str Boolean list tuple Dictionary

  14. Is there a limit for how large an integer value has to be ?

    There is no limit to how long an integer value can be. Of course, it is constrained by the amount of memory your system has but beyond that an integer can be as long as you need it to be.

  15. Define String.

    Strings are sequences of character data. The string type in Python is called str. String literals may be delimited using either single or double quotes.

  16. What is Boolean Type

    Python provides a Boolean data type. Objects of Boolean type may have one of two values, True or False.

  17. Define List

    A list is a collection which is ordered and changeable. In Python lists are written with square brackets.

  18. Define Tuple.

    A tuple is a collection which is ordered and unchangeable. Example : days = ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")

  19. What is Tuple Assignment ?

    Tuple Assignment is a powerful feature in python that allows a tuple of variables on the left of an assignment to be assigned values from a tuple on the right of the assignment. Example : (num1, num2)=(32, 55)

  20. Define Operators.

    Operators are special symbols that carry out some computations.

  21. What are the various types of operators available in python ?

    The various types of operators available in python are listed below, · Arithmetic Operator · Assignment Operator · Comparison Operator · Logical Operator · Identity · Membership

  22. What is operator precedence ?

    The order of evaluation of operators in an expression is called precedence of an operator.

  23. Define Associativity.

    Associativity is the order in which Python evaluates an expression containing multiple operators of the same precedence.

  24. Associativity of Python Operators?

    In python all operators except the exponent (**) support the left-to-right associativity. The exponent has right-to-left Associativity.

  25. what are comments ?

    A comment is a text that doesn't affect the outcome of a code. It is just a piece of text to let someone know what you have done in a program or what is being done in a block of code.

  26. Define function.

    A function is a group of related statements that perform a specific task. Functions help break our program into smaller and modular chunks.

  27. What is meant by flow of execution ?

    The order in which statements are executed in a program is called flow of execution.

  28. Define parameter.

    Parameter is a variable defined by a function that receives a value when the function is called.

  29. Define Argument

    Argument is a value or variable that is passed to a function when it is invoked.

  30. What is a module ?

    A module is a file that contains a collection of related functions.