Python Basics Quiz
31 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

An ordered set of instruction to be executed by a computer by a computer to carry out a specific task is called ______.

Program

Computer understand the language of 0s and 1s which is called

  • Algorithm
  • Pseudo code
  • Program
  • All of the above (correct)
  • A program written in a high-level language is called ______code.

    Binary language

    Language translator convert ______ code to ______ code.

    <p>Source, Object</p> Signup and view all the answers

    Which of the following is not correct about python?

    <p>Python is based an ABC language.</p> Signup and view all the answers

    Python is case sensitive.

    <p>True</p> Signup and view all the answers

    Which keyboard key is used to run python programs?

    <p>F5</p> Signup and view all the answers

    All keywords in Python are in lower case.

    <p>True</p> Signup and view all the answers

    Which of the following is not the feature of python language?

    <p>All of the above</p> Signup and view all the answers

    In which of the following mode, the interpreter executes the statement and displays the result as soon as we press 'Enter' key?

    <p>Interactive mode</p> Signup and view all the answers

    By default, the Python scripts are saved with ______ extension.

    <p>.py</p> Signup and view all the answers

    By default, the Python scripts are saved in ______.

    <p>Python installation folder</p> Signup and view all the answers

    ______ are reserved words.

    <p>Keywords</p> Signup and view all the answers

    Which of the following is not correct for naming an identifier in Python?

    <p>Spaces are allowed in identifiers</p> Signup and view all the answers

    Comments in python program are ______ by interpreter.

    <p>not executed</p> Signup and view all the answers

    In Python single line comment starts with ______.

    <h1></h1> Signup and view all the answers

    In Python multi line comment starts with ______.

    <p>'''</p> Signup and view all the answers

    Which of the following is a sequence data type?

    <p>String</p> Signup and view all the answers

    ______ is a set of valid characters that a language can recognize.

    <p>Token</p> Signup and view all the answers

    The smallest individual unit in a program is known as ______

    <p>Token</p> Signup and view all the answers

    Which of the following is invalid identifier?

    <p>Literals</p> Signup and view all the answers

    Which of the following statement is wrong?

    <p>break / FILE34 / F_L / Myname</p> Signup and view all the answers

    Identifier can start with number.

    <p>None of the above</p> Signup and view all the answers

    Variables of data types like integers, float etc., hold ______

    <p>single value</p> Signup and view all the answers

    An ______ is a symbol which is used to perform specific mathematical or logical operation on values.

    <p>Operator</p> Signup and view all the answers

    Operators work on values called ______.

    <p>Operand</p> Signup and view all the answers

    Operators working on Operand ______ data value.

    <p>data value</p> Signup and view all the answers

    Which of the following is number data type in python?

    <p>All of the above</p> Signup and view all the answers

    Binary operators are operators with ______ operands.

    <p>2</p> Signup and view all the answers

    In Python, we have ______ function for taking input from the user.

    <p>input()</p> Signup and view all the answers

    The user may enter a number or a string but the input() function treats them as ______.

    <p>strings only</p> Signup and view all the answers

    Study Notes

    Python Basics

    • Python is an ordered set of instructions executed by a computer to perform a task.
    • Python uses a high-level language, which is converted to machine code.
    • Python uses an interpreter to convert code.
    • Python is an open-source language developed by Guido van Rossum.
    • Python is case-sensitive.
    • Python's keywords are written in lowercase.
    • Python programs are run using the Ctrl + R key combination.

    Data Types and Variables

    • Variables can store different types of data.
    • Integers, floats, and strings are examples of data types.
    • Variables can hold a single value.
    • Variables start with a letter or underscore.

    Operators

    • Operators perform actions on data values.
    • Operators can be mathematical, logical, or comparison.

    Comments

    • Comments are notes in the code that do not affect the program's execution.
    • Single-line comments start with #.
    • Multi-line comments use triple quotes ("""...""").

    Identifiers

    • Identifiers are used to name variables, functions, classes.
    • Identifiers cannot start with numbers.
    • Reserved words (keywords) cannot be identifiers.

    Data Types

    • Integer, float, string, boolean, and complex are data types.

    Input/Output functions

    - input()
    
    • The input() function receives input from the user.
    • The user input can be treated either as a string or a number depending on the program.

    Python Statements

    • Python uses brackets (()), braces ({}), and parentheses ([]).
    • Python executes statements sequentially.

    Interactive mode

    • Interactive mode is when Python executes statements as soon as they're entered.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Description

    Test your understanding of Python basics, including data types, operators, and the use of comments. This quiz covers fundamental concepts essential for programming in Python. Perfect for beginners looking to solidify their knowledge.

    More Like This

    Python Programming Basics
    10 questions
    Python Programming Basics Quiz
    5 questions

    Python Programming Basics Quiz

    LowRiskHeliotrope8202 avatar
    LowRiskHeliotrope8202
    Python Programming Basics
    10 questions
    Use Quizgecko on...
    Browser
    Browser