Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void main() {
- int age = 23;
- String name = "Bruce";
- print('My name is ${name} and I am ${age} years old.');
- // for x in range(10)
- // for(initialization; condition; increment)
- for(int i = 0; i < 10; i = i+2){
- print(i);
- }
- if(10 >= 12){
- print("Good");
- }else{
- print("Bad");
- }
- // while(condition){
- // content;
- // }
- int my_age = getAge(2008);
- print(my_age);
- } //main
- // int getAge(){
- // int birth_year = 1997;
- // int current_year = 2022;
- // return current_year-birth_year;
- // }
- // def getAge(birth_year):
- // return 2022-birth_year
- // int getAge(int birth_year){
- // return 2022-birth_year;
- // }
- int getAge(int birth_year) => 2022-birth_year;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement