Posts

Showing posts from January, 2024

INPUT AND PRINT

INPUT PYTHON allows a user to give input and based on that a program will proceed further. In python, we pass some value to input() so that it tell the user what to give input.let us look at the exmaple below; UserName= input ("Enter name:") Print ("The name of user is" + username) in the above example, the user is asked to enter his/name. if the user entered "Piyush", the output will be: The name of the user is Piyush. PRINT We use the print () function to output data to screen. for example; Print('this sentence is output to the) Output of the above code would be : this sentence is output to the screen  We can also print the value assigned to a variable. a=5 print('the value of a is', a      output of the above code would be the value of a is 5 # Print the string "Hello World" print("Hello World") # Create a variable named myName and # set it to input("enter your name") myName = input("enter your name");

START: PYTHON INTRODUCTION

Image
WHAT IS PYTHON? Python is a Programming language used to give commands to the computer for performing a task.                                                                                  print("Curious Chatbot") name  = input( "what is your name?") print( "hello" , name, "! Nice to meet you!") doYouLikeCoding = input ("doYouLikeCoding?(Y/N)") if  (doYouLikeCoding  == 'y' or doYouLikeCoding == 'y'):       print ("Great ! You have  come to the right place then !") if (doYouLikeCoding ==  'n' or doYouLikeCoding ==  'N'):   print( "Aww shucks ! I just love. T thing you'll kike it too when you know how much fun it is!") favoritemovie  = input ("whic is your favorite move"?) if( favoritmovie == 'type your favorite movie' ):   Print( "mine too!!! we have so much in common!") Print( "that is a great movie! type your movie name!") Print( "It wa