Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 92 - Math_Genius_1 2
P. 92

    9         ikbFku esa oaQfM'kuy vkSj ywfiax LVsVesaV~l

                                    (Conditional and Looping Statements in

                                    Python)

                                     vkidk y{;

                                       fuEu osQ fo"k; esa tkuuk %
                                          buiqV( ) vkSj ¯izV( ) iaQD'ku               oaQfM'kuy LVsVesaV~l
                                          ywfiax LVsVesaV~l                           tai LVsVesaV~l

                      fiNys vè;k; esa vkius ik;Fku dh ewy ckrsa lh•h gSaA bl vè;k; esa vki ik;Fku osQ oaQfM'kuy] ywfiax vkSj tai
                      LVsVesaV osQ ckjs esa tkusaxsA

                                              a
                          buiqV vkSj fizaV QD'ku ( The Input and the Print Functions)
                      ge igys gh input( ) vkSj print( ) dk;ks± osQ ckjs esa tku pqosQ gSaA input( ) vkSj print( ) iaQD'ku dk mi;ksx fu"iknu
                      osQ nkSjku mi;ksxdrkZ ls buiqV ysus vkSj LØhu ij vkmViqV dks Øe'k% fçaV djus osQ fy, fd;k tkrk gSA vkb, bu nksuksa
                      dFkuksa osQ lkekU; okD;&foU;kl dks la'kksf/r djsaA

                      buiqV() iaQD'ku [The input() Function]
                      flaVSDl%   input("prompt")

                      mnkgj.k%   age = input("Enter your age")
                      bl mnkgj.k esa] mi;ksxdrkZ dks ^viuh vk;q n”kZ djsa* laosQr osQ ekè;e ls vk;q n”kZ djus osQ fy, dgk tk,xkA
                      mi;ksxdrkZ }kjk fn;k x;k eku ifjorZuh; vk;q esa lax`ghr fd;k tk,xkA input( ) LVsVesaV ges'kk fLaVªx çdkj dk eku
                      nsrk gSA int( ) vkSj float( ) iaQD'ku dk mi;ksx input( ) LVsVesaV osQ lkFk input( ) iaQD'ku osQ ekè;e ls çkIr ekuksa dks
                      Øe'k% iw.kk±d vkSj ÝyksV osY;w esa ifjo£rr djus osQ fy, fd;k tkrk gSA vki fuEufyf•r rjhosQ ls input( ) iaQD'ku
                      osQ lkFk int( ) vkSj float( ) iaQD'ku dk mi;ksx dj ldrs gSa%

                      age = int(input("Enter your age"))
                      Or
                      height = float(input("Enter your height"))

                      ¯izV() iaQD'ku [The print( ) Function]

                      flagSDl%   print("message", variable _ name)
                      mnkgj.k%   print( "Age is",x )
                      bl mnkgj.k esa] vkmViqV LØhu ij ^vk;q gS* lans'k osQ lkFk osfj,cy x dk eku çnf'kZr gksrk gSA
                      vkb,] ge input( ) vkSj print( ) iaQD'ku dk mi;ksx djosQ ,d ik;Fku çksxzke cukrs gSaA mnkgj.k osQ fy,]

                      name = input("Enter your name: ")
                      marks = int(input("Enter marks scored in maths:"))

                         90  Play (Ver. 1.0)-VIII

| 87 88 89 90 91 92 93 94 95 96 97 |