CodeSolved

A comprehensive source of programming questions and exercises

People's list table

Practice Easy 201/ Download 699 Views

Create a table and put the following people's information including name, city and age

Amir Hossein Tehran 23
Houshang Tehran 48
Leila Arak 39
Mehdi Qom 12
Zahra Mazandaran 33
Hussein Hamedan 56

11 Answers

This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
import pandas as pd

# Data
data = {
    'اسم': ['امیرحسین', 'هوشنگ', 'لیلا', 'مهدی', 'زهرا', 'حسین'],
    'شهر': ['تهران', 'تهران', 'اراک', 'قم', 'مازندران', 'همدان'],
    'سن': [23, 48, 39, 12, 33, 56]
}

# Create Dataframe
df = pd.DataFrame(data)

# Display the table
print(df)
User 136 Download Python
names['حسین','زهرا','مهدی','لیلا','هوشنگ','امیرحسین']
city=['همدان','مازندران','قم','اراک','تهران','تهران']
sen=[23,48,39,12,33,56]
i=0
while i<len(names):
    print(names[i],sen[i],city[i],end=' ')
    i+=1
    print('')
name=["امیرحسین","هوشنگ","لیلا","مهدی","زهرا","حسین"]
city=["تهران","تهران","اراک","قم","مازندران","همدان"]
age=[23,48,39,12,33,56]
for i in range(len(name)):
    print(name[i],city[i],age[i])
Yasin.hn Download Python
<!DOCTYPE html>
<html lang="fa">
    <head>
        <title> جدول</title>
        <style>
            table{
                background-color: bisque;
                margin-left: auto;
                margin-right: auto;
                text-align: center;
                border: 2px solid #000000;
                padding: 3px;
                border-radius: 10px;
            }
            td{
                background-color: azure;
                border: 1px solid #000000;
                padding: 4px;
                border-radius: 10px; 
                width: 50px;
            }
        </style>
    </head>
    <body>
        <table >
            <tr>
                <th>name</th>
                <th>city</th>
                <th>age</th>
            </tr>
            <tr>
                <td>امیرحسین</td>
                <td>تهران</td>
                <td>23</td>
            </tr>
            <tr>
                <td>هوشنگ</td>
                <td>تهران</td>
                <td>48</td>
            </tr>
            <tr>
                <td>لیلا</td>
                <td>اراک</td>
                <td>39</td>
            </tr>
            <tr>
                <td>مهدی</td>
                <td>قم</td>
                <td>12</td>
            </tr>
            <tr>
                <td>زهرا</td>
                <td>مازندران</td>
                <td>33</td>
            </tr>
            <tr>
                <td>حسین</td>
                <td>همدان</td>
                <td>56</td>
            </tr>
        </table>  
        
    </body>
</html>
*.*.*.*.*.*.*.*.* CSS *.*.*.*.*.*.*.*.*
    <style>
        body {
          background: #171b26;
        }

        div {
          width: 90%;
          background-color: #293143;
          margin: auto;
          border-radius: 10px;  
        }

        table {
            width: 95%;
            border-collapse: collapse;
            margin: 40px auto;
        }
        
        th, td {
            padding: 5px;
            text-align: center;
            border-bottom: 2px solid #232a39;
        }

        tr {
            background: #293143; 
            color: #ffffff;  
        }

        th {
            background-color: #293143;
            color: #fb4b83;
        }

        tr:hover {
            background-color: #343e56;
        }
    </style>

-_-_-_-_-_-_-_ HTML _-_-_-_-_-_-_-_-_
  <div>
    <table>
        <tr>
          <th>سن</th>
          <th>شهر</th>
          <th>نام</th>
        </tr>
        <tr>
          <td>23</td>
          <td>تهران</td>
          <td>امیرحسین</td>
        </tr>
        <tr>
          <td>48</td>
          <td>تهران</td>
          <td>هوشنگ</td>
        </tr>
        <tr>
          <td>39</td>
          <td>اراک</td>
          <td>لیلا</td>
        </tr>
        <tr>
          <td>12</td>
          <td>قم</td>
          <td>مهدی</td>
        </tr>
        <tr>
          <td>33</td>
          <td>مازندران</td>
          <td>زهرا</td>
        </tr>
        <tr>
          <td>56</td>
          <td>همدان</td>
          <td>حسین</td>
        </tr>
    </table>
  </div>
humans = [
    ("AmirHossine", "tehran", 23),
    ("Hooshang", "theran", 48),
    ("lyla", "arak", 39),
    ("mahdi", "goq", 12),
    ("zahra", "mazandaran", 33),
    ("hossine", "hamedane", 56)
]

for human in humans:
    print("They are humans")
    for h in human:
        print(h, end=" ")
Nima1393 Download Python
<!DOCTYPE html>
<html lang="fa" dir="rtl">
  <head>
    <meta charset="UTF-8">
  </head>
  <body>
    <table> 
      <tr>
            <th>
               اسم
            </th>
        <th>
        شهر
        </th>
    <th>
سن
    </th>
      </tr>

      <tr>
        <td>امیرحسین</td>
        <td>تهران</td>
        <td>23</td>
      </tr>

      <tr>
        <td>هوشنگ</td>
        <td>تهران</td>
        <td>48</td>
      </tr>

      <tr>
        <td>لیلا</td>
        <td>اراک</td>
        <td>39</td>
      </tr>

      <tr>
        <td>مهدی</td>
        <td>قم</td>
        <td>12</td>
      </tr>

      <tr>
        <td>زهرا</td>
        <td>مازندران</td>
        <td>33</td>
      </tr>

      <tr>
        <td>حسین</td>
        <td>همدان</td>
        <td>56</td>
      </tr>

    </table>
  </body>
</html>

<< Previous page 1 2 Next page >>

Submit answer

Submitting answers is currently unavailable.

Related content

Detection using AI
×
×
Close