0% found this document useful (0 votes)
4 views3 pages

Programming Summary

The document provides programming notes on Python, covering basic functions like print() and input(), as well as data types such as integers, floats, booleans, and strings. It explains variable naming conventions, the use of comments, and how to recognize and convert data types. Additionally, it outlines common coding errors including syntax, runtime, and semantic errors.

Uploaded by

nigeljonasi103
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Programming Summary

The document provides programming notes on Python, covering basic functions like print() and input(), as well as data types such as integers, floats, booleans, and strings. It explains variable naming conventions, the use of comments, and how to recognize and convert data types. Additionally, it outlines common coding errors including syntax, runtime, and semantic errors.

Uploaded by

nigeljonasi103
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

NIGEL JONASI PROGRAMMING NOTES

Print() ifunction inoita kuti wakainyora wobva waisa zvinhu zvaurikuda mubracket kuti zvibude
ndiyo yaunoshandisa sekuti print(“nigel”) panoranha program inongobudisa chete pakanzi
nigel.

Variables
Variable izita rinopiwa container raunostowera data sekuti a=5 , a ivariable na 5 ndiye data
rastowewa.

Pane 4 madata types anoti interger , floating , Boolean logical truth value and strings data types

Interger inonyorwa se int inenge ine mawhole numbers chete sekuti 1000

Floating inonyorwa se float inenge ine manumbers ane comma chete

Boolean inyorwa se bool inenge ine true kana false chete

String inongonyorwa se str inosanganisira maletters, mano’s kana kutii zvese se “nigel is 19
years old”

Mastrings anoiswa ma quote marks “nigel” always

Mamwe madata types haana basa ne maquote marks and haatoiswe

Amwe maprogramming languages ane basa ne kuspecifier kuti itype ipi yevariable sekuti str
a=”Shayne is 13 years old” asi python language haina basa nazvo

Zita revariable harifanire kutanga ne number

Zita revariable harifanire kuva nemaspaces , masymbols kana makeywords

Macomments aiswa futi pamacodes

Anoshandiswa kuexplainer zvirikuita macodes

Mupython anotanga na#

Hakanganise macodes uye haatobude panorunner program


Input function
Input() function inoshandiswa kuaccepter zvinhu zvinenge zvanyorwa nauser nekeyboady
ozvistowewa muvariable

Optionally function inospecifier string ine ine maquotes marks mukati me mabrackets , string iyi
inodisplayewa ichirequester input

Sekuti name=input(“please enter your name”) name ndiye variable

Print(“hello”,name)

Print(“welcome to coding for beginners”)

Print(“remember to have fun”,name)

Hapana need yekuisa maspaces pamacodes akaseparetwa na comma nekuti panorunner


program anoiginowewa saka pangapana comma panosara space

End=”” anoshandiswa kubatanidza 2 maline asina kubatana ichiisa kaline aka - pakati pacho

Sekuti print(“nigel”)

Print(“jonasi”) output nigel-jonasi

Aka – ndiko kanoedhewa

Recognizing data type


Kana Boolean , nefloat ne interger kana zvakavharwa nemaquote marks ane amastrings

Type() function
Type function inoshandiswa kudiscover type yedata inenge iri muvariable

Unofanira kuisa variable name mumabrackets type() kuti uudzwe

Sekuti race=”Daytona 500”

Print(race,”is”+type(race)) 0utput Daytona 500 is str

Variable name harifanire kuva nema quote marks


+ anoshandiswa kuplasa kana kuedha space kana kubatanidza 2 mastrings

Converting data
Numeric number anoiswa muvariable mucode yako ari automatically appointed data type ye
interger kana floating

Zvinhu zvinoiswa mumavariable kubva kuuser neinput() function zviri aoutomatically appointed
data type yestring chero ari manumbers

Int(x) – inokonivheta x kumuisa kuinterger

Float(x) –inokonivheta x kumuisa kuinterger

Str(x) –inokonivheta x kumuisa kustring

Pane 3 matypes emaerrors ecoding anoti syntax, runtime ne sematic error

Syntax inoitika kana wakanganisa marules ethat programming language sekuti wakanganisa
kuisa quote marks pamastrings. Uye inoitika before program yarunner

Runtime inoitika program yakurunner example kana variable name rakanganiswa kunyorwa
semanyorerwa aratanga rakaita sekuti tittle obva wati title saka variable name iyi inenge
yakusarecognizwa saka interpreter iri kurinner program inobva yamirira ipapo pane error
yaripota neword rakanzi exception

Sematic inoitika kana program yaburitsa output isiriyo sekuti wakatarisira 3*8+4=36 inobva
yaburitsa 28. Uye haimboonekwa neinterpreter

You might also like