Python is a programming language. Like other languages, it gives us a way to communicate ideas. In the case of a programming language, these ideas are “commands” that people use to communicate with a computer!
We convey our commands to the computer by writing them in a text file using a programming language. These files are called programs. Running a program means telling a computer to read the text file, translate it to the set of operations that it understands, and perform those actions.
my_name = "GreatToCode"
print("Hello and welcome " + my_name + "!")
my_name = "Arvind Upadhyay"
print("Hello and welacome " + my_name +"!")
x= "301"
print("This is my roll number " + x )
a= "computer science"
print("This is my stream of study " + a )
x= "BMC.IN"
print ("This is my college " + x )
Comments
Ironically, the first thing we’re going to do is show how to tell a computer to ignore a part of a program. Text written in a program but not run by the computer is called a comment. Python interprets anything after a #
as a comment.
Here is simple code for understanding of the comments in python .
#this is my first python program .
my_name = "arvind upadhyay"
print("This is my name " + my_name )
my_purpose = "Building & creating values "
print("This is what i do " + my_purpose )
#this is i was talking about my purpose .
our_company = "softwarewalafamily"
print(" This is our company where we work " + our_company )
#This is where we work .
our_goals = "Software solutions for everyone & smooth the function and operations of the organization "
print("Hello everyone , here is our goals " + our_goals )
#this was our primary goals .
Comments can:
- Provide context for why something is written the way it is:
# This variable will be used to count the number of times anyone tweets the word persnickety
persnickety_count = 0
- Help other people reading the code understand it faster:
# This code will calculate the likelihood that it will rain tomorrow
complicated_rain_calculation_for_tomorrow()
Print
Now what we’re going to do is teach our computer to communicate. The gift of speech is valuable: a computer can answer many questions we have about “how” or “why” or “what” it is doing. In Python, the
print()
function is used to tell a computer to talk.print("Hello world!")
print("We can what we think!")
my_city = "Mumbai"
print ("This is my city " + my_city)
#these are example how python print statements.
0 Comments