. Find the output of the following code:
x= “hello world”
print (x[ : 2], x[ : -2], x[-2 : ])
print (x[ 6 ], x[2 : 4])
print (x[ 2 : -3], x[ -4 : -2])
Answers
*Python:
If you want to print it as a heading, then you need to write" <h1>Hello World!</h1>
open your notepad or any other text editor (Not WordPad or ms word)
then save it by any name, after name give extension .html
then open the file and start coding... or copy it...
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Hello world in html</title>
</head>
<body>
<center>
<h1 style="color:green;display:block;font-family:monospace;">Hello World</h1>
</center>
</body>
</html>
- he hello wor ld
- w ll
- llo wo or