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



Download 2,02 Mb.
Pdf ko'rish
bet92/126
Sana01.01.2022
Hajmi2,02 Mb.
#285662
1   ...   88   89   90   91   92   93   94   95   ...   126
Bog'liq
Learning Python The Ultimate Guide for Beginners to Coding with

Using the input() Function
Have  you  ever  stopped  a  moving  vehicle?  Do  you  remember  what
happened? You waved your hand, and the vehicle stopped. The driver opens
the  door,  and  you  enter  before  he  zoomed  off.  Yes,  as  simple  as  that
illustration  is,  that  is  what  the  input()  function  works.  It  pauses  and  waits
for an input from the user. In a similar pattern, the driver stops, the car door
opens  before  you  hop  into  it.  In  Python,  the  moment  the  user  inputs  the
information, the value or information is assigned to a variable.
For instance, the program below requests the user to insert their first name
and surname. It further displays both names on the screen.
full_name = input(“Please, what is your first name and surname?”
print(full_name)
The input() function here prompts a message on what the user should do. In
this situation, it requests the users to enter their first name and surname. The
program will wait pending when the user has responded to the prompt, and
once the “Enter” key is pressed, the information is assigned to the variable
“full_name”  before  printing  the  content  of  the  information.  Assuming  the
user's inputs, “Amanda Norman,” the output will be:
Please, what is your first name and surname?
Amanda Norman
As simple as this, you have created your first program that requests input
from the user. Whenever you use the input() function, endeavor to include
an  understandable  prompt  message  on  what  the  user  should  do  or  what
Download 2,02 Mb.

Do'stlaringiz bilan baham:
1   ...   88   89   90   91   92   93   94   95   ...   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