Learning Python: The Ultimate Guide for Beginners to Coding with Python with Useful Tools



Download 2,02 Mb.
Pdf ko'rish
bet16/126
Sana01.01.2022
Hajmi2,02 Mb.
#285662
1   ...   12   13   14   15   16   17   18   19   ...   126
Bog'liq
Learning Python The Ultimate Guide for Beginners to Coding with

Multiple Line Statements
These statements normally terminate with a new line. Though, it allows you
to use a special character (\) to continue a statement. Check the code below:
Total_Number = number1 + \
number2 + \
number3
Notwithstanding,  there  is  an  exception  to  this  situation  if  such  statements
contain brackets such as (), {}, or []. For instance;


months = [‘December’, ‘November,’ ‘October,’ ‘September,’ ‘August,’
‘July,’  ‘June,’  ‘May,’  ‘April,’  ‘March,’  ‘February,’
‘January’]
Variables
A variable is a storage location, which has a name assigned to it. In Python,
we can assign a value to a variable and recall these variables. I believe an
example will make things clearer. Remember our first program (hello.py),
let us add an additional two lines. Consider the program below:
outcome= “Hello, Welcome to Python Programming!”
print(outcome)
When  you  run  the  program,  your  output  will  be  the  same  as  the  previous
one, which was:
Hello, Welcome to Python Programming!
The  only  difference  is  that  we  added  a  variable  called  “outcome.”  Each
variable  always  has  a  value  assigned  to  it.  In  this  situation,  the  value  of
“outcome” is “Hello Welcome to Python Programming!”
Let  us  add  two  additional  lines  to  the  previous  code.  However,  ensure  to
insert a blank line in the first code before adding the new codes.
outcome= “Hello, Welcome to Python Programming!”
print(outcome)
outcome = “Hello, Welcome to Learning Python!”
print(outcome)


After  adding  the  two  lines,  save  the  file  and  run  the  program  again.  Your
output will be as follows:
Hello, Welcome to Python Programming!
Hello, Welcome to Learning Python!

Download 2,02 Mb.

Do'stlaringiz bilan baham:
1   ...   12   13   14   15   16   17   18   19   ...   126




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish