Created
December 14, 2019 13:33
-
-
Save SOS77777/a361aff6f7ea87b1dbfa1279270f938f to your computer and use it in GitHub Desktop.
مراجعة لبعض النقاط فى list such as Random and contains
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math'; | |
main(){ | |
List<int> sohiup = []; | |
Random random = Random(); | |
for(int i = 0 ; i < 100 ;i ++){ | |
int mohammed = random.nextInt(500); | |
sohiup.add(mohammed); | |
} | |
for(int e in sohiup ){ | |
if(e % 2 == 0 ) { | |
print('i found it $e'); | |
}else{ | |
print('t not found it'); | |
} | |
} | |
if(sohiup.contains(100)) { | |
int a = sohiup.indexOf(100, 1); | |
print('he is $a in $sohiup'); | |
}else{ | |
print('not found it'); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment