CBSE Class 9 AI (Artificial Intelligence) | 18. PRINT by Abraham | Learn Smarter
K12 Students

Academics

AI-Powered learning for Grades 8–12, aligned with major Indian and international curricula.

Professionals

Professional Courses

Industry-relevant training in Business, Technology, and Design to help professionals and graduates upskill for real-world careers.

Games

Interactive Games

Fun, engaging games to boost memory, math fluency, typing speed, and English skills—perfect for learners of all ages.

18. PRINT

The print() function in Python is essential for displaying output to users, allowing for effective communication of messages, variable values, and computations. Understanding its syntax, parameters, and capabilities, such as formatting options and escape characters, is crucial for programming. The chapter explores various ways to utilize print() for strings, numbers, and dynamic messages, emphasizing correct usage and common errors.

Enroll to start learning

You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.

Sections

  • 18

    Print

    The print() function in Python is crucial for displaying output, allowing programmers to present messages, variable values, and calculations on the screen.

  • 18.1

    What Is The Function?

    The print() function in Python is a built-in utility used to display output on the screen, enabling the programmer to show messages and variable values.

  • 18.2

    Printing Strings

    In this section, students learn about the print() function in Python specifically for displaying strings.

  • 18.3

    Printing Numbers And Expressions

    This section discusses how to use the print() function in Python to display numbers and solve arithmetic expressions.

  • 18.4

    Printing Multiple Values

    The print() function in Python can accept multiple values, allowing for streamlined output formatting.

  • 18.5

    The Parameter Sep

    The sep parameter in the print() function determines how multiple items are separated when printed.

  • 18.6

    The Parameter End

    The end parameter of the print() function in Python defines what is printed at the end of the output, allowing customization beyond the default newline.

  • 18.7

    Escape Characters

  • 18.8

    Printing Variables

    This section covers how to use the print() function in Python to display the values of variables.

  • 18.9

    Printing Using F-Strings (Formatted Strings)

    F-strings allow direct embedding of variables inside strings for easier and more readable formatting in Python.

  • 18.10

    Printing With .format()

    The .format() method in Python allows for dynamic string formatting and inserting variables into strings effortlessly.

  • 18.11

    Printing With Concatenation

    This section explains the concept of string concatenation in Python using the print() function, showcasing how to combine strings with the + operator.

  • 18.12

    Common Errors

    This section addresses common errors in using the print() function in Python, particularly related to mixing data types.

References

ch18.pdf

Class Notes

Memorization

What we have learnt

  • The print() function is a b...
  • Users can customize output ...
  • Escape sequences allow the ...

Final Test

Revision Tests