Quelle est la syntaxe correcte d'une boucle for en R ?

QCM3 5 boucles et conditions

Quiz
•
Information Technology (IT)
•
University
•
Easy
Marion WILTHIEN
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
for (i from 1 to 5) { print(i) }
for i in 1 to 5 { print(i) }
for (i in 1:5) { print(i) }
for (i to 5) { print(i) }
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Quelle est la sortie de ce code : for (i in 1:3) { print(i^2) }
1, 2, 3
1, 4, 9
2, 3, 4
1, 8, 27
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Quelle est la structure correcte d'une condition if en R ?
if [x > 10] { print("x est grand") }
if (x > 10) { print("x est grand") }
if x > 10 then print("x est grand")
if {x > 10} print("x est grand")
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Que fait le code suivant ? x <- 5 if (x > 3) { print("x est supérieur à 3") } else { print("x est inférieur ou égal à 3") }
Affiche "x est supérieur à 3"
Affiche "x est inférieur ou égal à 3"
Erreur de syntaxe
Rien
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Quelle est la sortie de ce code : for (i in 1:4) { if (i %% 2 == 0) { print(i) } }
1, 3
2, 4
1, 2, 3, 4
2
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Quelle est la sortie de ce code : x <- 10 if (x < 5) { print("Petit") } else if (x == 10) { print("Exact") } else { print("Grand") }
"Petit"
"Exact"
"Grand"
Erreur
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Quelle boucle est utilisée pour parcourir les éléments d'un vecteur en R ?
while
for
repeat
next
Create a free account and access millions of resources
Similar Resources on Quizizz
10 questions
QCM 5 R sur le package ggplot2

Quiz
•
University
15 questions
TD1-RA&RV

Quiz
•
University
15 questions
TD7-RA&RV

Quiz
•
University
12 questions
Quizz IMTBS intervention mc2i

Quiz
•
University
10 questions
JS#4

Quiz
•
University
15 questions
Bases de Python

Quiz
•
University
13 questions
Les alimentations

Quiz
•
5th Grade - University
11 questions
Quiz sur Tailwind CSS

Quiz
•
University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade