Post

Kode Gurukul
Kode Gurukul@kodegurukul·
Answer is 0123. 💯The for loop iterates over a sequence of numbers generated by the range() function. The range() function generates a sequence of numbers from 0 up to (but not including) the length of the string 'abcd'. 👉len(string) returns the length of the string, which is 4 . 👉range(len(string)) generates a sequence of numbers from 0 to 3. 👉 So print will print these numbers from 0 to 3.
Kode Gurukul tweet media
English
0
0
11
467
Dr. Sultan
Dr. Sultan@SultanAcademyUS·
@Python_Dv The answer is 0 1 2 3 len() will return 4 (the number of characters in the string) range(4) will return 0 1 2 3 and doesn't include 4. So the answer is 0 1 2 3
English
0
0
2
222
Prem Prakash
Prem Prakash@4EverPrem·
@Python_Dv 0 1 2 3. len(string)) = 4 range(len(String))=> range(0,4)=> start index = 0, end index = 4 excluding 4, effectively means stop at index 3
English
0
0
1
104
Muhammad Hunain
Muhammad Hunain@Hunain_5698·
@Python_Dv Length of string is 4 Range function starts from 0 and ends at 3 The output will be 0 1 2 3 So, A is the right answer
English
0
0
0
81
Chávez
Chávez@j_c_studio·
@Python_Dv A for loop that prints the length of the string, that starts with 0 and ends with 3, end=" " means to print all numbers in one line. The answer is A
English
0
0
0
115
Paylaş