class studentDetails {  
   var stnames: String  = "Ram"
   var marks1: Int   = 50
   var marks2: Int  = 60
   var marks3: Int  = 80
 
  func  StDetails() {
       print("Name is \(stnames) & Marks in physics \(marks1) in chemistry \(marks2) &  in  Maths is \(marks3)")
     
     
   }  
} 
var std =  studentDetails()
std.StDetails()

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: