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
Exam (elaborations)

python

Rating
-
Sold
-
Pages
1
Grade
A
Uploaded on
29-12-2023
Written in
2023/2024

introduction to python

Institution
Course

Content preview

Learning Python Programming Language: Exercise on Print Function
In the previous video, we learned how to print something on the console using
Python. Now, let's do an exercise on the print function. We want to print three
lines exactly as shown:

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.

In the next video, we will discuss string manipulations and how to use them in the
print function.

Sporting exercise is an important aspect of learning theory concepts. In addition
to the theory, we also have a video coding exercise that demonstrates the concept
in action. Stay tuned for the next video. Until then, take care!

Written for

Institution
Secondary school
Course
School year
5

Document information

Uploaded on
December 29, 2023
Number of pages
1
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

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
karthiks1

Get to know the seller

Seller avatar
karthiks1 Self
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

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