Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. myCars = [Car("Red", 1986), Car("Black", 2007), Car("Blue", 1993)]
  2. # and then going through the cars:
  3. for car in myCars:
  4. print("The car has the color " + car.color + " and is " + (2014 - car.year) + " years old.")
  5.  
  6. struct Car {
  7. string color;
  8. int year;
  9. };
  10.  
  11. int bilar[3] = {Car cars[0], Car cars[1], Car cars[2]}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement