Skip to content

Instantly share code, notes, and snippets.

@SOS77777
Created December 14, 2019 13:33
Show Gist options
  • Save SOS77777/a361aff6f7ea87b1dbfa1279270f938f to your computer and use it in GitHub Desktop.
Save SOS77777/a361aff6f7ea87b1dbfa1279270f938f to your computer and use it in GitHub Desktop.
مراجعة لبعض النقاط فى list such as Random and contains
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