Python Syntax - Everything you need to know!

Stefan Rows
1 Sept 202216:52

Summary

TLDRThis video tutorial offers an in-depth introduction to Python syntax, focusing on indentation with spaces or tabs, emphasizing readability and uniformity. It covers the significance of using snake case for variables and functions, pascal case for classes, and capitalized snake case for constants, as per PEP 8 guidelines. The tutorial also explains the use of comments with hashtags, string literals with different quote types, and techniques for managing long statements with backslashes. Aimed at beginners, the video simplifies complex concepts and encourages interactive learning through a provided repository for hands-on practice.

Takeaways

  • πŸ˜€ Python uses indentation with spaces or tabs for code structuring, unlike languages like JavaScript that use semicolons.
  • πŸ“ The PEP 8 style guide recommends using four spaces for indentation if spaces are chosen, and one tab if tabs are used.
  • πŸ‘€ Consistency is key: never mix spaces and tabs in Python code.
  • πŸ”‘ Functions in Python are defined using the `def` keyword, followed by the function name and colon.
  • πŸ“ Comments in Python are made using the `#` symbol, which is essential for code readability and collaboration.
  • πŸ” String literals in Python can be declared using single quotes, double quotes, or triple quotes for multi-line strings.
  • πŸ“‘ Multi-line strings are useful for preserving formatting, such as line breaks, in the output.
  • πŸ”— Long statements in Python can be split into multiple lines using a backslash for better readability.
  • πŸ“ Casing conventions in Python are important for readability: snake_case for variables, functions, methods, and modules; PascalCase for classes; and UPPER_CASE for constants.
  • 🌐 For further learning, the video suggests checking out the Python category on cosec.com for tutorials, written articles, and coding repositories.

Q & A

  • What is the primary focus of the video?

    -The primary focus of the video is to teach the basics of Python syntax, including code structuring, indentation, and commenting.

  • Why is indentation important in Python?

    -Indentation is important in Python because it is used for code structuring, distinguishing blocks of code such as functions, loops, and conditionals.

  • What is the recommended number of spaces for indentation according to PEP 8?

    -According to PEP 8, the recommended number of spaces for indentation is four.

  • Can you use tabs for indentation in Python?

    -Yes, you can use tabs for indentation in Python, but it is recommended to use spaces for consistency, and mixing spaces and tabs is discouraged.

  • How does Python handle the end of statements compared to other languages like JavaScript?

    -Python does not require a semicolon at the end of statements like JavaScript does. Instead, Python uses indentation to define the end of a statement.

  • What is the purpose of comments in Python code?

    -Comments in Python code serve to explain the code, making it easier to understand for both the developer and others who may read the code. They are also useful for temporarily disabling code during testing.

  • How do you create a comment in Python?

    -In Python, you create a comment by starting the line with a hashtag (#), and the rest of the line is treated as a comment and not executed.

  • What are the different ways to declare strings in Python?

    -In Python, you can declare strings using single quotes ('string'), double quotes ("string"), triple single quotes ('''string'''), or triple double quotes ("""string""") for multi-line strings.

  • Why would you use multi-line strings in Python?

    -Multi-line strings are used in Python when you want to preserve whitespace and line breaks in the output, which is not possible with single-line strings.

  • How can you separate long statements in Python for better readability?

    -You can separate long statements in Python for better readability by using a backslash (\) at the end of the line before the line break.

  • What are the casing conventions for different elements in Python according to PEP 8?

    -According to PEP 8, variables, functions, methods, and modules should be in snake_case, classes should be in PascalCase, and constants should be in UPPER_SNAKE_CASE.

Outlines

00:00

🐍 Python Syntax Basics

This paragraph introduces the basics of Python syntax, emphasizing the importance of indentation using white spaces or tabs. It explains that Python uses indentation to structure code, contrasting with languages like JavaScript that use semicolons. The speaker recommends using tabs for uniformity but also mentions the PEP 8 style guide, which suggests using four spaces if spaces are chosen. The paragraph also touches on the debate between tabs and spaces, highlighting the need to be consistent. The tutorial includes a practical example of creating a function in Python and how indentation works within it. The benefits of using indentation are discussed, such as better readability and ease of understanding code structure.

05:01

πŸ“ The Role of Comments in Python

The second paragraph delves into the significance of comments in Python programming. It highlights how comments serve as a tool for communication among developers and as a memory aid for oneself when revisiting old projects. The paragraph explains that comments are not executed and are marked by a hashtag. It also stresses the importance of commenting in professional programming, as it aids collaboration and code understanding. The tutorial demonstrates how to write single-line comments and briefly mentions the use of multi-line comments, although the focus remains on the syntax and purpose of comments rather than their detailed usage.

10:02

πŸ”€ Understanding Python Strings and Long Statements

This paragraph focuses on Python's handling of strings, known as string literals. It explains the different ways to declare strings using single, double, or triple quotes, and the importance of matching the type of quote at the beginning and end of the string. The paragraph demonstrates the use of multi-line strings for preserving spaces between lines when printed, contrasting this with single-line strings. It also touches on the use of backslashes to separate long statements for better readability, providing an example of an if statement that continues across lines. The speaker emphasizes the importance of proper casing in Python, according to PEP 8 guidelines, for variables, functions, methods, modules, classes, and constants.

15:02

πŸ”‘ Key Python Syntax Elements

The final paragraph summarizes the key elements of Python syntax covered in the tutorial. It reiterates the use of spaces or tabs for indentation, the importance of snake case for variables and functions, pascal case for classes, and capitalized snake case for constants. It also reminds viewers of the use of backslashes to split long statements and the use of different quote types for string literals. The paragraph concludes by encouraging viewers to explore more Python tutorials on the website, suggesting that these resources will further enhance their understanding of Python programming.

Mindmap

Keywords

πŸ’‘Indentation

Indentation in Python refers to the use of whitespace to define the block of code. It is a fundamental concept in Python syntax, as it replaces the need for braces or semicolons found in other programming languages. The video emphasizes the importance of indentation for structuring code, such as within functions. For instance, when a function is defined, the subsequent lines of code are indented to show that they are part of the function's body. The script mentions that indentation can be done using spaces or tabs, but it should be consistent throughout a project, aligning with the PEP 8 style guide which recommends four spaces per indentation level.

πŸ’‘PEP 8

PEP 8 is the style guide for Python code, providing conventions to follow for writing readable and consistent code. The video discusses PEP 8 in the context of indentation, recommending the use of four spaces for each indentation level. Adhering to PEP 8 not only makes Python code more readable but also helps in maintaining a uniform coding style across different projects and developers.

πŸ’‘Syntax

Syntax in programming refers to the set of rules that dictate how code should be structured. The video focuses on Python syntax, particularly on how indentation is used to structure code blocks. The script explains that Python syntax is designed to be readable and less prone to errors due to its reliance on indentation, as opposed to other languages that use semicolons or braces to denote code blocks.

πŸ’‘Comments

Comments in programming are notes or explanations added to the source code that the compiler or interpreter does not execute. In the video, it is mentioned that comments are essential for describing code, aiding both the original developer and others in understanding the purpose and functionality of the code. In Python, a comment is created by prefixing a line with a '#' symbol. The script demonstrates how to write single-line comments and emphasizes their importance in programming practices.

πŸ’‘Strings

Strings in Python are sequences of characters used to represent text. The video explains how to declare strings using single quotes, double quotes, or triple quotes. Single or double quotes are used for single-line strings, while triple quotes are used for multi-line strings, allowing for line breaks within the string. The script provides examples of declaring strings and printing them, highlighting the flexibility in using different types of quotes.

πŸ’‘Multi-line Strings

Multi-line strings in Python are strings that span multiple lines, allowing for the inclusion of line breaks and formatting. The video demonstrates the use of triple quotes to create multi-line strings, which is useful for preserving the structure of text, such as when writing code that includes blocks of text or when formatting output to include line breaks. The script shows how multi-line strings can be used to print text with spaces between lines, which is not possible with single-line strings.

πŸ’‘Long Statements

Long statements in Python are code lines that exceed the typical line length for readability. The video discusses the use of a backslash to split long statements into multiple lines, which helps in maintaining the readability of the code. This is particularly useful when dealing with complex expressions or assignments that would otherwise clutter the code. The script provides an example of using a backslash to continue an 'if' statement on the next line.

πŸ’‘Casing

Casing in programming refers to the convention of writing variable names, function names, and other identifiers. The video explains the importance of casing in Python, adhering to the PEP 8 style guide. It mentions that variables, functions, methods, and modules should be in snake case, classes in Pascal case, and constants in capitalized snake case. The script provides examples of each casing style and emphasizes the role of casing in making code more readable and maintainable.

πŸ’‘Snake Case

Snake case is a naming convention where each word in a name is separated by an underscore and all letters are in lowercase. In the video, it is mentioned that snake case is used for variables, functions, methods, and modules in Python. The script illustrates how to write identifiers in snake case, such as 'python_syntax', and explains that this style helps in making the code more readable and consistent.

πŸ’‘Pascal Case

Pascal case is a naming convention where each word in the name starts with a capital letter and there are no spaces or underscores. The video explains that in Python, Pascal case is used exclusively for class names. The script provides an example of a class name written in Pascal case, such as 'PythonSyntax', and highlights its use in differentiating class names from other types of identifiers.

Highlights

Introduction to Python syntax tutorial for beginners.

Python tutorials available on cosec.com for further learning.

Emphasis on the importance of indentation in Python code structure.

Discussion on the personal preference between using spaces or tabs for indentation.

Recommendation to adhere to PEP 8 style guide for indentation consistency.

Explanation of how to use tabs and spaces for proper code indentation.

Demonstration of automatic indentation in Python code editors.

Illustration of creating and calling a function in Python.

Clarification on the absence of semicolons at the end of statements in Python.

Advantages of using indentation for code readability and structure.

Introduction to the use of comments in Python with '#'.

Explanation of the importance of comments for code clarity and collaboration.

Guidelines on declaring strings in Python using single, double, or triple quotes.

Demonstration of printing strings with single and multi-line formats.

Explanation of when to use multi-line strings for formatting purposes.

Introduction to long statements and their separation using a backslash.

Discussion on the importance of casing in Python for readability.

Explanation of snake case, pascal case, and capitalized snake case in Python naming conventions.

Summary of the key points covered in the Python syntax tutorial.

Invitation to explore more Python tutorials on cosec.com.

Transcripts

play00:00

hey guys what's up everyone in today's

play00:02

video i will show you everything that

play00:05

you need to know about the python syntax

play00:08

as you know we have a bunch of new

play00:10

python tutorials on our website

play00:12

cosec.com and this is one of the first

play00:14

tutorials you should look at if you are

play00:16

interested in learning the python

play00:18

programming language i'm going to show

play00:21

you all of this in a replied repository

play00:24

which you can go and fork and play

play00:27

around with yourself this is the best

play00:28

way to practice python i'll leave a link

play00:31

to that in the video description and you

play00:33

can also find a link in the written

play00:35

article for that you can just fork it

play00:37

you can create a free account and then

play00:39

directly code along so i recommend you

play00:41

to do that before we get started so in

play00:44

python we use white spaces or

play00:47

indentation for code structuring if you

play00:50

have been coding in other languages such

play00:52

as javascript before you probably have

play00:54

seen that certain statements are ended

play00:57

with a semicolon like so this is not the

play01:00

case in python in python everything is

play01:02

structured using white space

play01:05

it is up to you if you want to use

play01:06

spaces or tabs which kind of is a

play01:09

ongoing discussion between people who

play01:12

prefer tabs over spaces or vice versa

play01:14

but it's really personal preference we

play01:17

like to use tabs because it keeps

play01:18

everything more uniform

play01:20

but do note if you use spaces according

play01:23

to the official pep8 style guide you

play01:25

should use four spaces for indentation

play01:29

and if you use tabs just one tab is fine

play01:32

you should never mix spaces and tabs

play01:34

always stick with one so if you use a

play01:37

one tab here that's one tab but if you

play01:39

actually look at four spaces one two

play01:41

three four that's a bit further and then

play01:43

indented um but that's fine if you use

play01:46

tabs which we do recommend you for ease

play01:48

of use uh then

play01:51

one tab is just fine

play01:53

so let's look at an actual python code

play01:55

snippet now don't worry about any of the

play01:58

things that i'm writing here don't need

play01:59

to understand it it's simply about

play02:01

indentation if you create a function in

play02:03

python we use the dev keyword and then

play02:06

we do the name of our function

play02:09

and then we do parentheses on the end

play02:12

and a colon and then we do a print

play02:15

statement here and you can see while i

play02:16

was pressing enter here it already

play02:19

automatically indented our code which

play02:22

means that we are now working inside of

play02:24

this function so we do

play02:26

hello from our function this is a simple

play02:29

print statement you will learn more

play02:30

about this later again this is only

play02:32

about the structure of the code and now

play02:34

if i hit enter once more then i'm still

play02:37

inside of this code block and if i hit

play02:39

enter once more at least here in replied

play02:41

every editor is different but most of

play02:43

them have some form of auto indentation

play02:46

and that's how you can work and if you

play02:49

want to actually get back into the

play02:51

function you can just go back one step

play02:53

up and then press the tab key and you

play02:55

will be in the exact same line here

play02:57

and this is exactly what we are talking

play02:59

about so this is the indentation

play03:02

now if we actually want to call the

play03:03

function we do our function and

play03:07

parentheses on the end

play03:08

and then if we run our code our code

play03:11

will run and print the statement that's

play03:13

coming from our function but again don't

play03:15

focus on what is all of that here just

play03:18

focus on the indentation part and you

play03:20

can see that this is clearly indented

play03:22

one tab in

play03:24

you may also recognize that we don't

play03:26

need any kind of semicolon at the end of

play03:30

our function statement or of our print

play03:33

function here

play03:34

we don't need any of that so this not

play03:37

only allows us to write less code but

play03:39

also makes it more of a human readable

play03:41

language that actually reads a little

play03:43

bit like english

play03:45

to summarize here

play03:47

why or what are some advantages of using

play03:49

this approach there is better

play03:51

readability clearly defined functions by

play03:54

using indentation indentation is

play03:56

required which makes reading other

play03:58

developers code easier so if you jump

play04:01

into code of some other developer that

play04:02

you haven't been working with before and

play04:05

it's all correctly indented you can

play04:06

directly see that this is part of the

play04:09

function and if it would be indented

play04:11

that way you would see that it's

play04:13

actually not in the function and the

play04:15

function is empty so once you develop a

play04:18

little bit of an eye for that then you

play04:20

can better understand why we indent code

play04:23

there is also a lower barrier of entry

play04:26

it makes learning python syntax easier

play04:28

compared to other languages

play04:30

so

play04:31

all of that green syntax you see up here

play04:34

is a comment and comments are essential

play04:37

in programming let's write another

play04:39

comment down below here

play04:41

so this is a single

play04:44

line comment in python

play04:48

and

play04:49

it won't

play04:51

run

play04:52

if you execute your

play04:54

code comments and programming languages

play04:57

are an essential tool to describe your

play05:00

code not only if you work together with

play05:03

other developers as previously mentioned

play05:05

but also for yourself if you have a

play05:07

project that you haven't been working on

play05:09

for longer periods of time you will

play05:11

forget parts or sometimes all of it

play05:14

all of its functionality

play05:16

comments help us to remember what we

play05:18

have written and with pointing out key

play05:20

elements of our codes

play05:22

functionality writing comments is

play05:24

required in most programming related

play05:26

jobs since you almost always collaborate

play05:29

with other developers on different

play05:31

projects commenting in python is

play05:33

straightforward to write a comment you

play05:35

simply put a hashtag in front of your

play05:38

comment like so

play05:40

and this indicates a comment to the

play05:42

compiler and it won't run this piece of

play05:44

text when you run your code another

play05:47

essential part of the python syntax or

play05:49

understanding the python syntax are

play05:51

strings or so called string literals so

play05:54

if you're declaring strings in python

play05:56

you have a bunch of options here you can

play05:59

declare a string let's first create a

play06:01

variable here let's call it our string

play06:04

this is how you declare a variable in

play06:06

python if you haven't seen that before

play06:07

and we can go and we can declare a

play06:09

string by using single quotes we can

play06:12

call that our string

play06:14

but we can also use double quotes

play06:16

instead of single quotes and it doesn't

play06:18

really make a difference we just have to

play06:20

make sure to not use too many quotes so

play06:22

we only use double quotes for this and

play06:25

this will work just the same and to

play06:27

prove that to you let's just print that

play06:29

out here print

play06:31

our string

play06:32

and we quickly

play06:34

comment out that function call here and

play06:36

that's also a way how you can just

play06:38

comment out code that you don't want to

play06:41

run when you're testing something so

play06:43

this is printing out our string

play06:45

let's put that back to single quotes to

play06:48

demonstrate that it's actually working

play06:51

and then if you print that out

play06:53

that prints out exactly the same we can

play06:56

also use triple single quotes or triple

play06:59

double quotes but it's crucial that you

play07:02

always start and end a string by using

play07:05

the same type of quotes for example if

play07:07

you start your string with a double

play07:09

quote you can't end it with a single

play07:12

quote so let's look at some examples

play07:14

below to better understand that whole

play07:16

concept

play07:17

let's create a single

play07:20

line

play07:20

string here

play07:22

and give that

play07:24

single quotes and then we say this

play07:27

is a single line string using single

play07:31

quotes okay so this is our single line

play07:34

now we print it all out in the end let's

play07:36

create a bunch of strings that we can

play07:38

look at the output all together then we

play07:41

create another

play07:42

single line

play07:46

string and we equal that to

play07:49

this is another single

play07:52

line string using double

play07:55

quotes

play07:56

okay this is our second string

play07:59

and then we create a multi-line string

play08:02

so to create multi-line strings we are

play08:04

going to use triple single quotes or

play08:06

triple double quotes we do multi

play08:09

line

play08:10

string

play08:11

equals and then we do triple quotes and

play08:13

if you just hit the button three times

play08:16

it will automatically create triple

play08:17

quotes here so you can see we have six

play08:19

quotes all together and now we can go

play08:22

ahead and we can do

play08:23

this is a multi

play08:27

line string using triple quotes

play08:32

now let's create a final one that we

play08:35

call another

play08:37

multi

play08:39

line string and equal that to

play08:43

three

play08:44

double quotes

play08:45

uh triple quotes

play08:47

yeah two

play08:48

okay now i'm getting confused it's six

play08:51

triple six double quotes and uh then we

play08:54

do this is a multi-line string using

play08:59

triple double oh my god triple double

play09:03

quotes okay there we go now if you want

play09:05

to print out all of that we can simply

play09:07

do that by using a print statement so we

play09:09

do print

play09:11

single

play09:12

line

play09:14

string

play09:15

and then we just copy that a bunch of

play09:17

times so we don't always need to reprint

play09:19

it or retype it we do that four times

play09:23

and we do

play09:24

it's the other one called

play09:26

another

play09:27

single line string and then we do

play09:30

multi-line string

play09:33

multi

play09:34

line string

play09:36

and then we do another multi-line string

play09:40

another

play09:41

multi-line

play09:43

string there we go so if you print all

play09:46

of that out

play09:47

we get the result and you immediately

play09:49

can see that there's actually a space

play09:51

between these and there is no space in

play09:54

here

play09:55

so why do we actually use multi-line

play09:57

strings we use multi-line strings if we

play09:59

want to have some space in between the

play10:02

lines that we are printing and this is

play10:03

exactly what we are seeing here now if

play10:05

we go to the triple single quotes

play10:08

uh line of code and we say this is a

play10:11

multi-line string using triple quotes

play10:13

and we just hit enter and we gifted some

play10:15

space in between and then we run the

play10:18

code then you can actually see that

play10:19

those

play10:20

lines have actually been separated so

play10:23

this is not the case if we do that in a

play10:25

single line string so if we would do

play10:27

that here it would already give us an

play10:29

error because it recognizes that it's

play10:31

only single quotes or single double

play10:34

quotes in that case and it doesn't allow

play10:36

us to hit the enter button but the same

play10:38

is true for the triple double quotes

play10:41

here we can also use the enter key here

play10:44

to create some space between the print

play10:46

statements and if we look at that again

play10:49

you can see that that is actually

play10:50

printing out with space in between

play10:53

so to summarize that we use

play10:56

multi-line strings to print out spaces

play10:59

between our lines and we use usually

play11:02

single

play11:04

single line strings using single quotes

play11:06

or double quotes when we just want to

play11:08

print out a single line with any space

play11:10

in between

play11:11

so this is also an essential part of

play11:14

python syntax so the next thing we want

play11:16

to take a brief look at are so called

play11:18

long statements in the python

play11:20

programming language it is sometimes

play11:22

required to use longer statements that

play11:24

need to be separated for better

play11:26

readability and we can utilize a

play11:29

backslash to achieve that so what i'm

play11:31

talking about here is if you write a

play11:33

very long statement that would exceed

play11:36

the line here and in your code editor

play11:38

you maybe would not see the line anymore

play11:39

because it got too long then we can

play11:41

utilize a backslash to separate that

play11:43

line

play11:44

much like in those multi-line strings so

play11:48

to do that i create a simple if

play11:50

statement here to demonstrate that for

play11:51

you don't worry about the logic here it

play11:53

doesn't it's not necessary it's just

play11:54

about the syntax

play11:56

so if we do a simple uh statement here

play11:59

where we check if some numbers are equal

play12:01

to another or bigger or smaller than the

play12:03

other one

play12:04

we can just do that by creating a simple

play12:07

number game here and then we do another

play12:09

end statement and now let's say if we

play12:11

want to continue this

play12:13

logic on the next line we can do a

play12:15

backslash here and then we press enter

play12:17

now we need to indent our code here a

play12:19

little bit for that to work and then we

play12:22

do another

play12:23

condition down here and then we do a

play12:25

colon at the end and then we want to

play12:28

print out something if that all if all

play12:31

these conditions are true so we do multi

play12:35

line statement is running

play12:39

and let's actually check if that works

play12:42

and it is working the multiline

play12:44

statement is running so this is good to

play12:47

know because if you run a very long

play12:49

statement or if you write very long

play12:50

statements here then you might run out

play12:52

of space and it gets hard to read so

play12:54

separating them in different lines makes

play12:57

it a lot easier

play12:58

the last thing i want to quickly talk

play13:00

about when it comes to understanding a

play13:02

basic python syntax is casing

play13:05

so by casing i mean how do we actually

play13:08

write our variable names and so on and

play13:10

so forth

play13:12

so we do casing and then we look at some

play13:14

examples so while sticking to casing

play13:17

isn't mandatory for your code to work it

play13:19

is highly recommended to stick with the

play13:20

recommended casing standards for python

play13:23

according to pep8 and those standards

play13:25

are

play13:26

variables functions methods and modules

play13:29

are written in snake case classes are

play13:31

written in pascal case and constants are

play13:33

written in capitalized snake case we

play13:36

highly recommend sticking to these

play13:37

guidelines which helps tremendously with

play13:39

making your code better readable both

play13:41

for you and anyone who works with you

play13:44

let's take a quick look at some of the

play13:47

examples below then you better

play13:49

understand what i'm actually talking

play13:50

about so camel case means capitalizing

play13:54

the first letter of each word except the

play13:56

first one and removing all spaces we do

play13:59

python

play14:01

syntax and equal that to a string that's

play14:04

camel case

play14:05

so this is how camel case looks like

play14:07

that's actually not used in python a lot

play14:11

very rarely i see that and it's not

play14:13

recommended in the style guide so this

play14:14

is just for you to understand what camel

play14:16

case is the next one is important that's

play14:19

pascal case capitalizing all first

play14:21

letters and removing all spaces so we do

play14:24

python syntax it would look like this

play14:26

and then we say it's pascal

play14:29

case

play14:30

okay so pascal case is only used for

play14:33

class names in python

play14:36

for class names

play14:39

okay so we got that the next one is

play14:42

snake case snake case is written like

play14:44

this python syntax

play14:47

and then we equal that to

play14:50

snake

play14:51

snake case is used for variables

play14:54

functions methods and modules

play14:59

is used for

play15:01

variables

play15:02

functions

play15:05

methods

play15:07

and modules okay

play15:10

and the last one is capitalized

play15:14

snake case

play15:16

so we do

play15:17

python

play15:19

syntax

play15:21

and

play15:22

capitalized is used for constants is

play15:25

used for

play15:26

constants

play15:28

now you don't need to worry about what

play15:29

constants are we have another article

play15:31

and video when you want to learn more

play15:32

about constants i'll link it in the

play15:34

video description below and you will

play15:36

learn everything you need to know about

play15:38

pyson if you just check out our python

play15:40

category on cosec.com

play15:42

so to summarize what you have learned

play15:45

today python code is indented with

play15:48

spaces or tabs that was the first thing

play15:50

we were talking about

play15:52

in python we use snake case for

play15:54

variables functions methods and modules

play15:56

we use pascal case for classes we use

play15:58

capitalized snake case for constants as

play16:00

you j as you just have seen here we can

play16:02

separate long statements with the use of

play16:04

a backslash we can use different types

play16:07

of quotes for string literals that's

play16:09

what you have seen here

play16:11

and finally we can use hashtags for

play16:14

writing comments now if you want to

play16:17

learn more about python we highly

play16:20

recommend checking out our python

play16:22

category on cosec.com if you click on

play16:24

learn on the top navigation bar and

play16:26

click on python there are all of our

play16:28

python tutorials and all of our python

play16:30

tutorials usually come with a

play16:32

corresponding replica that you can

play16:34

directly code with us and with a

play16:36

corresponding video as well if you

play16:38

prefer video content over written

play16:40

content make sure to bookmark the

play16:42

website and also make sure to check out

play16:45

our regular videos alright guys that's

play16:48

it thank you for watching and i hope to

play16:49

see you back in the next video

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Python SyntaxCoding TutorialsIndentation GuidePEP8 StandardsCode ReadabilityVariable NamingString LiteralsCode CommentsCasing ConventionsProgramming Best Practices