Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Python

Rating
-
Sold
-
Pages
1
Uploaded on
04-03-2024
Written in
2023/2024

First line: "First Program - Python Print Function" Second line: "It is declared like this: print()" Third line: "What to print" To print this, we simply need to write the statements inside the print function.

Institution
Course

Content preview

Python print function

First line: "First Program - Python Print Function"

Second line: "It is declared like this: print()"

Third line: "What to print"

To print this, we simply need to write the statements inside the print function. The first line is easy,
just write "First Program - Python Print Function" inside the print function. For the second line, write
"It is declared like this: print()" inside the print function. For the third line, write "'What to print'"
(with the single quotes) inside the print function.



Once you have written the code, create a new file called "exercise1.py" and write the code in there.
Then, run the code to see the output.



Using Single Quotes vs Double Quotes

When using the print function, you can enclose the string or message in either single quotes or
double quotes. However, if you want to print single quotes within your string, you need to be careful.
For example, if you try to enclose the entire string in single quotes and include a single quote within
the string, Python will interpret the single quote as the end of the string and give you an error. To
avoid this, you can enclose the string in double quotes and include the single quotes within the
string.

Written for

Course

Document information

Uploaded on
March 4, 2024
Number of pages
1
Written in
2023/2024
Type
Class notes
Professor(s)
Jenny
Contains
All classes

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
stu_malavikha_g

Get to know the seller

Seller avatar
stu_malavikha_g C.T.T.E college for women
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
2
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions