Обсуждения
If except can handle common errors very well, doesn't that make the use of raise redundant inside of a try-except block?
For example:
try:
print( 5 / 0 )
except ZeroDivisionError:
raise ValueError("An error occurred!")
What's the difference if we handle it this way:
try:
print( 5 / 0 )
except (ZeroDivisionError, ValueError):
print("An error occurred!")
3 голосов
2 ответовQ1: should we always assign one svg size if more than one graphs are drawn?
Q2: again, I want to make two different animations of different shapes? in the same svg, without changing the size, no result?
Q3: and again, in a same svg sized, want to make path with combinations of C, S , A etc, no results?
what is proper ways to do the above? what attentions should we pay to ?
0 голосов
2 ответовIs it possible to make my code run without having to press Enter on my IDE? For example: if I'm making a calculator and I want the calculations to be made as soon as I press "=" after typing the numbers and the operator?
Say I wanted to add two numbers: can it calculate automatically as soon as I write "2+3=" without having to press Enter?
0 голосов
5 ответов
what have i to do, if i want that the program always writes for example :
0+1
1+2
3+3
6+4
10+5
15+6
...
because now it just writes
1
3
6
10
15
...
and maybe if it works, can i make then
0+1=1
1+2=3
3+3=6
6+4=10
#include <iostream>
using namespace std;
int main(){
int i;
int sum = 0;
for (i = 1; i <= 100; i++){
sum = sum+i;
cout<<sum<<endl;
}
cout<<sum;
return 0;
}
1 голос
5 ответовI have a project in school and i want to add some login functions. know im planning to make an external js and there i will get the input of the user.In the login button i will put there the username input but how do i cancel the funtion if the users input is null and where should i put these method
THANKS FOR THE FUTURE HELP :)
0 голосов
2 ответовWhat is the output and why?
public static int[] make (int n){
int[]a=new int [n];
a [i]=i+1;
}
return a;
}
public static void dub (int []jub){
for (intent i=0;i <jub.length;i++){
jub*=2;
}
}
public static int mus (int []zoo){
int jus=0;
for (int i=0;i <zoo.length;i++){
jus+=zoo [i];
}
return jus;
}
public static void main (String [] args){
int [] bob =make(5);
dub (bob);
System.out.println (mus (bob));
}
0 голосов
2 ответовwhat languages are needed to allow customers to upload a form to a server, which can then be displayed on another page (Similar to ebay). i cant wrap my head around what code is needed (other than the method=post)...i have created a database using sql but cant make sense of how to allow a user to enter details...for it to then appear on the home page of my website for example. many thanks!
0 голосов
2 ответовАктуальное сегодня
Sticky position
3 Votes
Help please?
3 Votes
Ejercicio Pytho
0 Votes
Online voting system
2 Votes
What is that z for
0 Votes
Suggestions needed
4 Votes
SQL practice
2 Votes