• Home
  • Courses
  • School
  • Programs
  • Problems
  • Contact Us
  • My account
  • Register

Have any question?

(+91) 98222 16647
info@simplycoding.in
RegisterLogin
Simply Coding
  • Home
  • Courses
  • School
  • Programs
  • Problems
  • Contact Us
  • My account
  • Register

Python

Crack CBSE Python Questions on Tokens

  • Categories Python, Python Tokens, Python
Python Questions on Tokens

Below are few CBSE Python Questions on Tokens (2 marks).

1)Identify which Python token are these?
  1. and   
  2. _value   
  3. True 
  4.  <=
Ans.
  1.              Keyword
  2.              Identifiers
  3.              Boolean literals
  4.              Relational Operator  
 
2)Determine the  type of literals below.
  1.              -19

  2.              0o12

  3.              0XFACE

Ans.
  1.            Decimal integer literals
  2.            Octal Integer Literals
  3.            Hexadecimal Integer Literals  
 
3)Identify which of the following as valid variable names, state reason if invalid.
  1.       _ 100
  2.      var.1
  3.      break
  4.      A463
  5.      T 204
Ans.
  1.       Valid as it begins with (underscore).
  2.       Invalid, dot (.) is not allowed.
  3.       Invalid, as break is a keyword.
  4.       Valid
  5.       Invalid, space is not allowed.  
4)Identify the following literals as character/string literals:
  1.      \t 
  2.      A1 
  3.      Nilam Sing#?9
  4.      \56
Ans.
  1.       Character
  2.       String
  3.       String
  4.       String  
 
5)What will be the sizes of following constants 
  1.    ‘\a’   
  2.   “\a” 
  3.    “it’s” 
  4.   ‘\”’ 
  5.    “Reema\’s”  
Ans.                                       
  1.  ‘\a’   – Size is 1 as there is 1 character and it is a string literal enclosed in single quotes
  2. “\a”  – Size is 1 as there is 1 character enclosed in double quotes 
  3.  “it’s” – Size is 4. Python allows single quotes                                    
  4.  ‘\”’    – size is 1                                      
  5.  “Reema\’s”- Size is 7 (\’ is considered as single character)    
 
6)Which of the following are valid comments?
  1.       /* comment */ 
  2.      */comment*/
  3.      ‘’’ comment 
  4.      //comment
Ans.
Comments a and d is valid.
 
7)What is equivalent scientific notation of following:
  1.   5.18 x 108 
  2.   25.4821 
  3.   0.641 x 10-3 
  4.   36.148
Ans.
  1.       5.18E + 08
  2.       2.54821E + 01
  3.       6.41E-04
  4.       3.6148E + 01  
 
8)What is escape sequence for new line and vertical tab?
Ans. “\n” for new line and “\v” for Vertical tab.
 
9)Identify the following literals:
  1.       0.23 
  2.      True 
  3.      ‘b’ 
  4.     “a”
Ans.
  1.     Floating point literal
  2.     Boolean literal
  3.     Character literal
  4.     String literal  
 
10)Identify errors in following statements and correct them:
  1.      number = 5,000 
  2.      byte x= = 3
  3.      x/10 = y 
  4.      number = +20     
Ans. correct statement:
  1.         number = 5000
  2.         byte = 3
  3.         y= x/10
  4.         number += 20

  • Share:
author avatar
Simply Coding

Previous post

Python Problems on Strings
April 24, 2020

Next post

Practice short problems on Python Random Module
April 25, 2020

You may also like

Data Types
Python Data Types
15 June, 2021
Tokens1
Python Tokens
15 June, 2021
Random Module
Practice short problems on Python Random Module
25 April, 2020

Leave A Reply Cancel reply

You must be logged in to post a comment.

Categories

  • Uncategorized
  • Programs
    • Python
    • Java
  • Problems
    • Python
    • Java
    • Web Development
      • Internet
    • Emerging Technologies
  • Notes
    • General
    • QBasic
    • MS Access
    • Web Development
      • XML
      • HTML
      • JavaScript
      • Internet
    • Database
    • Logo Programming
    • Scratch
    • Emerging Trends
      • Artificial Intelligence
      • Internet of Things
      • Cloud Computing
      • Machine Learning
    • Computer Fundamentals
      • Computer Networks
      • E-Services
      • Computer Hardware
    • Python
    • Java
  • School
    • ICSE
      • Computers Class 9
        • Java Introduction
        • Tokens & Data Types
        • Java Operators
        • Math Library
        • if & switch
        • For & While
        • Nested loops
      • Computer Class 10
        • Sample Papers
        • OOPS concepts
        • Functions in Java
        • Constructors
        • Arrays in Java
        • Strings in Java
    • SSC
      • IT Class 11
        • IT Basics
        • DBMS
        • Web Designing
        • Cyber Laws
      • IT Class 12
        • Web Designing
        • SEO
        • Advanced JavaScript
        • Emerging Tech
        • Server Side Scripting
        • E-Com & E-Gov
      • Computer Science 11
      • Computer Science 12
    • CBSE
      • Computer 9
        • Basics of IT
        • Cyber Safety
        • Scratch
        • Python
      • Computer 10
        • Sample Papers
        • Networking
        • HTML
        • Cyber Ethics
        • Scratch
        • Python
      • Computer Science 11
        • Computer Systems
        • Python 11
          • Python Basics
          • Python Tokens
          • Python Operators
          • Python if-else
          • Python loops
          • Python Strings
          • Python List
          • Python Tuple
          • Python Dictionary
          • Python Modules
        • Data Management
      • Computer Science 12
        • Sample Papers
        • Python 12
          • Python Functions
          • Python File Handling
          • Python Libraries
          • Python Recursion
          • Data Structures
        • Computer Networks
        • Data Management
    • ISC
      • Computer Science 11
        • Introduction to Java
        • Values & Data Types
        • Operators
        • if & switch
        • Iterative Statements
        • Functions
        • Arrays
        • String
        • Data Structures
        • Cyber Ethics
      • Computer Science 12
        • Sample Papers
        • Boolean Algebra
        • OOPS
        • Wrapper Classes
        • Functions
        • Arrays
        • String

Categories

  • Uncategorized
  • Programs
    • Python
    • Java
  • Problems
    • Python
    • Java
    • Web Development
      • Internet
    • Emerging Technologies
  • Notes
    • General
    • QBasic
    • MS Access
    • Web Development
      • XML
      • HTML
      • JavaScript
      • Internet
    • Database
    • Logo Programming
    • Scratch
    • Emerging Trends
      • Artificial Intelligence
      • Internet of Things
      • Cloud Computing
      • Machine Learning
    • Computer Fundamentals
      • Computer Networks
      • E-Services
      • Computer Hardware
    • Python
    • Java
  • School
    • ICSE
      • Computers Class 9
        • Java Introduction
        • Tokens & Data Types
        • Java Operators
        • Math Library
        • if & switch
        • For & While
        • Nested loops
      • Computer Class 10
        • Sample Papers
        • OOPS concepts
        • Functions in Java
        • Constructors
        • Arrays in Java
        • Strings in Java
    • SSC
      • IT Class 11
        • IT Basics
        • DBMS
        • Web Designing
        • Cyber Laws
      • IT Class 12
        • Web Designing
        • SEO
        • Advanced JavaScript
        • Emerging Tech
        • Server Side Scripting
        • E-Com & E-Gov
      • Computer Science 11
      • Computer Science 12
    • CBSE
      • Computer 9
        • Basics of IT
        • Cyber Safety
        • Scratch
        • Python
      • Computer 10
        • Sample Papers
        • Networking
        • HTML
        • Cyber Ethics
        • Scratch
        • Python
      • Computer Science 11
        • Computer Systems
        • Python 11
          • Python Basics
          • Python Tokens
          • Python Operators
          • Python if-else
          • Python loops
          • Python Strings
          • Python List
          • Python Tuple
          • Python Dictionary
          • Python Modules
        • Data Management
      • Computer Science 12
        • Sample Papers
        • Python 12
          • Python Functions
          • Python File Handling
          • Python Libraries
          • Python Recursion
          • Data Structures
        • Computer Networks
        • Data Management
    • ISC
      • Computer Science 11
        • Introduction to Java
        • Values & Data Types
        • Operators
        • if & switch
        • Iterative Statements
        • Functions
        • Arrays
        • String
        • Data Structures
        • Cyber Ethics
      • Computer Science 12
        • Sample Papers
        • Boolean Algebra
        • OOPS
        • Wrapper Classes
        • Functions
        • Arrays
        • String
Simply Coding Computer Courses for School                Privacy Policy     Terms of Use     Contact Us

© 2021 Simply Coding

Login with your site account

Lost your password?

Not a member yet? Register now

Register a new account

Are you a member? Login now