Обсуждения
How this code can be re-writed?
0 голосов
1 ответIn the continue Loop -
i = 0
while True:
i = i +1
if i == 2:
print("Skipping 2")
continue
if i == 5:
print("Breaking")
break
print(i)
print("Finished")
It shows the output being
"1
Skipping 2
3
4
Breaking
Finished"
Why are the last three lines not
"Breaking
5
Finished"
Where it shows print(i) after break?
1 голос
3 ответовGregorianCalendar
0 голосов
1 ответjavascript code
0 голосов
1 ответ"Cannot set 0 of undefined"
1 голос
1 ответin order to find the sum of n numbers given by user,suppose our program is to find the sum of any 4 numbers given by user (using while loop such that (while(i<=4))and incrementing each value of i by 1),if the user give any 2 inputs instead of four then the total sum should be the summation of that two inputs..but the program shows the sum something else,why it is so??
2 голосов
3 ответовHow can I read from a file this line
19 34 Gateway Arch - St. Louis, MO.
The first digit is age, second timeUsed, and the rest description. So I want to read them and store them in a variable.
The code insime my while loop of my File is int age = reader.nextInt();
Int Tused = reader.nextInt();
Description = reader.next()
0 голосов
4 ответовWhen Bongi's new baby, Sipho, was born,she opened a savings account woth R1000.00. On each daybitthday,starting with the first,the bank added 4.5% of the balnce and Bongi added another R500.00 to the account.Write a loop that will calculate how much money was in the account on Sipho's 18th birthday?
0 голосов
2 ответовInstream & outstream
0 голосов
1 ответHow do I do this?
-3 голосов
2 ответовWrite a java program that generates the binomial coefficients for (x +y)^14 prints them, separated by a comma and a space use a loop or loops to increment the integer n and k after they are initialized.
Hint:for the above problem the coefficients ate the 15th row of pascal triangle
0 голосов
2 ответовPrinting pattern with Javascript
0 голосов
1 ответPointer in array
0 голосов
1 ответNeed help with project python?
0 голосов
1 ответIn the short code below, I declared an array of five elements. But I'm getting confused on how to use it in a while loop. My main question is , if the user inputs a userchoice1 value that is less than 1, I want the code to keep looping until the user inputs a number that is not less than 1. But I don't know if the 7th line (userchoice1 [x]++) shows the right way to loop it.
1 голос
2 ответовАктуальное сегодня
Sticky position
2 Votes
Help please?
3 Votes
Online voting system
2 Votes
What is that z for
0 Votes
Suggestions needed
4 Votes
SQL practice
2 Votes
Game development
0 Votes
Ruby programming?
3 Votes