Skip to main content

Posts

Showing posts from May 18, 2020

Python Input and Escape sequence character in hindi (Part -5)

Subscribe * indicates required Email Address *                                                     Input in Python Python mai hm input le skte hai input function ki help se , input lena mtlb hm saamne se value denge num1 or num2 ki. num1= input ( "enter a number:" ) num2= input ( "enter a number:" ) print ( int (num1)+ int (num2)) output enter a number:56 enter a number:85 141 to hm simply input function ka use krke input le skte hai , lekin ap yaha dekh skte hai ki hmne print statement mai kya print karaya hai , hamne int(num1) + int(num2) likha hai iska mtlb hamne type cast kiya hai to hm type cast kyo kr rahe hai jbki hamne dono value interger value li hai to answer hai jb bhi ham input function ka use krke input lete hai to jo value ham input le rahe hai wo value string mai store hoti hai na ki integer mai isliye ham string ko int mai convert krke addition kr rahe hai.                                

Python Operation and type conversion in hindi (Part -4)

Subscribe * indicates required Email Address *                                     Python  (Addition, Substraction, Multiplication, Division) Pichhle post mai hamne discuss kiya tha Python variables ke baare mai aur dekha tha ki ham python variable ko kaise declare kr skte hai. Is post mai hm baat krenge ki Python mai hm kaise addition , substraction , multiplication , division operation ka use kr skte hai. Agar apko do number ko add krna hai to ap kaise kr skte hai , jaise mujhe 3 or 4 ko add krna hai to kaise krunga aaiye dekhte hai a= 3  b=4 c = a+b print(c) output = 7 ye bilkul ek simple mathematical operation hai hmne a mai 3 ko store kiya aur b mai 4 ko store kiya , aur c mai a+b yani 7 ko store kiya aur fir print kara diya , print statement simply print krta hai jo bhi hamara output hota hai. Kuch log soch rahe honge ki output to c aana chahiye kyoki hmne print mai c likha hai lekin nhi ap galat soch rahe ho agar main