-


'i'  Integer  Whole number between -32,768 and 32,767  2  'l'



Download 9,79 Mb.
Pdf ko'rish
bet37/64
Sana16.01.2022
Hajmi9,79 Mb.
#372467
1   ...   33   34   35   36   37   38   39   40   ...   64
Bog'liq
[Nichola Lacey] Python by Example Learning to Pro(1)

'i' 
Integer 
Whole number between -32,768 and 32,767 

'l' 
Long 
Whole number between -2,147,483,648 and 
2,147,483,647 

'f' 
Floating-point 
Allows decimal places with numbers ranging 
from -10
38
 to 10
38 
(i.e. allows up to 38 numeric 
characters including a single decimal point 
anywhere in that number and can be negative or 
positive value) 

'd' 
Double 
Allows decimal places with numbers ranging 
from -10
308
 to 10
308
 

 
When you create your array you need to define the type of data it will contain. You cannot 
alter or change this while the program is running. Therefore, if you define an array as an 'i' 
type (this allows whole numbers between the values −32,768 and 32,767) you cannot add a 
decimal point to a number in that array later as it will cause an error message and crash the 
program. 
Please note:
 
Other programming languages use the term array to 
allow the storage of any data type, but in Python arrays only store numbers whereas lists 
allow the storage of any data type. If you want to create a variable that stores multiple 
strings, in Python you need to create a list rather than an array. 
 
 
  


Challenges 88 - 95: Numeric Arrays 
773 
 
 
 
Example Code 
 
 
 
 
 
 
 
 

Download 9,79 Mb.

Do'stlaringiz bilan baham:
1   ...   33   34   35   36   37   38   39   40   ...   64




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