alternative
  • Home (current)
  • About
  • Tutorial
    Technologies
    SQL -Structured Query Language
    Python
    Ethical Hacking
    Java
    .net Framework
    Placement Preparation
    Quantitative Aptitude
    View All Tutorial
  • Quiz
    SQL -Structured Query Language
    Quantitative Aptitude
    Java
    View All Quiz Course
  • Q & A
    Quantitative Aptitude
    Java
    View All Q & A course
  • Programs
  • Articles
    Artificial Intelligence & Machine Learning Project
    How to publish your local website on github pages with a custom domain name?
    How to download and install Xampp on Window Operating System ?
    How To Download And Install MySql Workbench
    How to install Pycharm ?
    How to install Python ?
    How to download and install Visual Studio IDE taking an example of C# (C Sharp)
    View All Post
  • Tools
    Program Compiler
    Sql Compiler
    Replace Multiple Text
    Meta Data From Multiple Url
  • Contact
  • User
    Login
    Register

Python - Things to know before proceed - Keyword Quiz

# Quiz
1
Discuss
Keyword

What will be the output of the following Python code snippet?

X=”hi”
print(“05d”%X)

 

  • 1]

    error

  • 2]

    hi000

  • 3]

    000hi

  • 4]

    00000hi

Solution
2
Discuss
Keyword

What will be the output of the following Python expression if x=456?

print("%-06d"%x)

 

  • 1]

    000456

  • 2]

    456

  • 3]

    456000

  • 4]

    error

Solution
3
Discuss
Keyword

What will be the output of the following Python expression if X=345?

print(“%06d”%X)

 

  • 1]

    000000345

  • 2]

    000345

  • 3]

    345000

  • 4]

    345000000

Solution
4
Discuss
Keyword

Which of the following formatting options can be used in order to add ‘n’ blank spaces after a given string ‘S’?

  • 1]

    print(“-ns”%S)

  • 2]

    print(“-ns”%S)

  • 3]

    print(“%ns”%S)

  • 4]

    print(“%-ns”%S)

Solution
5
Discuss
Keyword

What will be the output of the following Python expression if X = -122?

print("-%06d"%x)

 

  • 1]

    -00122

  • 2]

    –00122

  • 3]

    000122

  • 4]

    -000122

Solution
6
Discuss
Keyword

What will be the output of the following Python expression if the value of x is 34?

print(“%f”%x)

 

  • 1]

    34.00000000

  • 2]

    34.000000

  • 3]

    34.0000

  • 4]

    34.00

Solution
7
Discuss
Keyword

What will be the output of the following Python expression if x=56.236?

print("%.2f"%x)

 

  • 1]

    0056.236

  • 2]

    56.23

  • 3]

    56.24

  • 4]

    56.00

Solution
8
Discuss
Keyword

What will be the output of the following Python expression if x=22.19?

print("%5.2f"%x)

 

  • 1]

    22.20

  • 2]

    22.19

  • 3]

    22.00000

  • 4]

    22.1900

Solution
9
Discuss
Keyword

The expression shown below results in an error.

print("-%5d0",989)

 

  • 1]

    True

  • 2]

    False

Solution
# Quiz
Python

Python

  • Introduction
  • Installation and running a first python program
    • How to install Python ?
    • Running 1st Hello World Python Program
    • How to install Pycharm ?
  • Things to know before proceed
    • Escape Characters/Special Characters
    • Syntax ( Indentation, Comments )
    • Variable
    • Datatype
    • Keyword
    • Literals
    • Operator
    • Precedence & Associativity Of Operator
    • Identifiers
    • Ascii, Binary, Octal, Hexadecimal
    • TypeCasting
    • Input, Output Function and Formatting
  • Decision control and looping statement
    • if-else
    • for loop
    • While loop
    • Break Statement
    • Continue Statement
    • Pass Statement
  • Datatype
    • Number
    • List
    • Tuple
    • Dictionary
    • String
    • Set
    • None & Boolean
  • String Method
    • capitalize()
    • upper()
    • lower()
    • swapcase()
    • casefold()
    • count()
    • center()
    • endswith()
    • split()
    • rsplit()
    • title()
    • strip()
    • lstrip()
    • rstrip()
    • find()
    • index()
    • format()
    • encode()
    • expandtabs()
    • format_map()
    • join()
    • ljust()
    • rjust()
    • maketrans()
    • partition()
    • rpartition()
    • translate()
    • splitlines()
    • zfill()
    • isalpha()
    • isalnum()
    • isdecimal()
    • isdigit()
    • isidentifier()
    • islower()
    • isupper()
    • isnumeric()
    • isprintable()
    • isspace()
    • istitle()
  • Python Function
    • Introduction
  • Lambda Function
    • Lambda Function
  • Python Advanced
    • Iterators
    • Module
    • File Handling
    • Exceptional Handling
    • RegEx - Regular Expression
    • Numpy
    • Pandas

About Fresherbell

Best learning portal that provides you great learning experience of various technologies with modern compilation tools and technique

Important Links

Don't hesitate to give us a call or send us a contact form message

Terms & Conditions
Privacy Policy
Contact Us

Social Media

© Untitled. All rights reserved. Demo Images: Unsplash. Design: HTML5 UP.