-


get_name() ,  print_Msg()



Download 9,79 Mb.
Pdf ko'rish
bet47/64
Sana16.01.2022
Hajmi9,79 Mb.
#372467
1   ...   43   44   45   46   47   48   49   50   ...   64
Bog'liq
[Nichola Lacey] Python by Example Learning to Pro(1)

get_name()

print_Msg()
 and 
main()
.  
The 
get_name()
 subprogram will ask the user to input their name and then it will return 
the value of the variable “user_name” so that it can be used in another subprogram. This is 
very important. If you do not return the values, then the values of any variables that were 
created or altered in that subprogram cannot be used elsewhere in your program. 


1100 
 
Challenges 118 - 123: Subprograms 
 
 
The 
print_Msg()
 subprogram will display the message “Hello” and then the user name. 
The variable “user_name” appears in the brackets as the current value of the variable is 
being imported into the subprogram so it can be used. 
The 
main()
 subprogram will get the user_name from the 
get_name()
 
subprogram 
(using the variable user_name) as this was returned from the 
get_name()
 subprogram. It 
will then use that user_name variable in the 

Download 9,79 Mb.

Do'stlaringiz bilan baham:
1   ...   43   44   45   46   47   48   49   50   ...   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