Back to articles
TASK 1

TASK 1

via Dev.to PythonJAYA SRI J

Hi all this is my task one with simple questions 1.Printing “Hello, world!” concept: the print() function is used to print the output. print ( " Hello, world! " ) Explanation: Anything inside quotes is a string. Python prints it exactly as it is. 2.Printing variable Concept: Variables store values. name = " Syed Jafer " print ( name ) Explanation: Instead of printing text directly, we store it in a variable and print it. Printing Multiple Variables with Labels Concept: Combine text with variables. name = " Syed Jafer " age = 20 city = " Chennai " print ( " Name: " , name ) print ( " Age: " , age ) print ( " City: " , city ) Explanation: Comma , automatically adds a space between values. 4.Using f-strings (Modern Method) Concept: Clean and readable formatting. print ( f " Name: { name } , Age: { age } , City: { city } " ) Explanation: f allows inserting variables inside {} directly. Concatenating Strings Concept: Joining strings using +. greeting = " Hello " target = " world " print ( g

Continue reading on Dev.to Python

Opens in a new tab

Read Full Article
2 views

Related Articles