0% found this document useful (0 votes)
6 views3 pages

Coding Worksheet

The document contains a coding worksheet with Python and HTML exercises. It includes Python codes for printing natural numbers, even numbers, odd numbers, cubes of numbers, and a multiplication table. Additionally, it provides HTML codes for creating ordered lists, nested lists, tables, and forms.

Uploaded by

reemaranisamal11
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Coding Worksheet

The document contains a coding worksheet with Python and HTML exercises. It includes Python codes for printing natural numbers, even numbers, odd numbers, cubes of numbers, and a multiplication table. Additionally, it provides HTML codes for creating ordered lists, nested lists, tables, and forms.

Uploaded by

reemaranisamal11
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CODING WORKSHEET

[Link] a python code to print the first 5 natural number


Ans: i=1
while i<=5:
print (i)
i=i+1
[Link] a python code to print the first 5 even number
i=2
while i<=10:
print (i)
i=i+2
[Link] a python code to print the first 5 odd number
i=1
while i<=10:
print (i)
i=i+2
[Link] a python code to print the cube of numbers between 5 and 15
i=5
while i<=15:
print (i*i*i)
i=i+1
Q5. Write a python code to print the table of number entered by the user.
n= int(input(“Enter a number:”))
i=1
while i<=10:
print(n, ‘X’, I, ‘=’, n * i)
i=i+1

B. HTML coding

1. Write the HTML code for the following output using <ol> Tag

Output(Question) Coding(Answer)
Orderly List <html>
I like to eat <head>
a. Apple <h1>Ordered List </h1>
b. Orange </head>
c. Banana <body>
<p>I like to eat</p>
<ol type= “a”>
<li>Apple</li>
<li>Orange</li>
<li>Banana</li>
</ol>
</body></html>
2. Write the HTML code for the following output using <ul> Tag

Output(Question) Coding(Answer)
Nested List <html>
a. Fruits <head>
 Apple <h1>Nested List </h1>
 Orange <ol type="a">
 Banana <li>Fruits</li>
<ul>
<li>Apple</li>
<li>Orange</li>
<li>Banana</li>
</ul>
</body></html>

3. Write the HTML code for the following output using <table> tag.

Output(Question) Coding(Answer)
<html>
<body>
First Name Last Name Marks <table border="1">
<tr>
<th>First Name</th>
Rohit Shrama 82
<th>Last Name</th>
Aariti Yadav 62 <th>Marks</th>
</tr>
Ram Khmar 80 <tr>
<td>Rohit</td>
<td>Shrama</td>
<td>82</td>
</tr>
<tr>
<td>Aariti</td>
<td>Yadav</td>
<td>62</td>
</tr>
<tr>
<td>Ram</td>
<td>Khmar</td>
<td>80</td>
</tr>
</table>
</body>
</html>
4. Write a HTML code to make the form using <form> Tag.

Output(Question) Coding(Answer)

<html>
<body>
Name:
<form>
Name: <input type="text"><br><br>
Father's Name: Father’s Name: <input type="text"><br><br>

Gender:
Gender: Male Female <input type="radio" > Male
<input type="radio"> Female<br><br>
Hobbies: Reading Sports
Hobbies:
Submit <input type="checkbox"> Reading
<input type="checkbox"> Sports<br><br>

<input type="Button" value="Submit">


</form>
</body>
</html>

You might also like