Questions tagged as 'booleano'

1
answer

How does Python determine if a value is true?

I have the following question: >>> a = [200,100] >>> a[True] Output >>> 100 >>> a = [200,100] >>> a[False] Output >>> 200 Why does this happen? Is the first value f...
asked by 21.01.2018 / 19:05
2
answers

Launching exceptions based on prime number

   Write a function that receives a number, throws an exception if the number is not positive and returns true if it is prime, or false, otherwise. My answer: public static void main(String []args) throws Exception{ Scanner sc = new Sc...
asked by 19.08.2016 / 18:46
1
answer

What's wrong with the logic of this'Python 'code?

x = bool(input("True or False...? ")) if x == 'True': print("Você escollheu True") else: print("Você escolheu False") What is wrong with this logic, more specifically about the logic involving the Boolean variable?     
asked by 10.12.2016 / 03:14
2
answers

Boolean function simplification

I came up with a Boolean function and would like to know if there is a simpler form or if mine is right. The function is: Icameupwiththefollowinganswer: I'm in doubt if this is the simplest solution I could get ...     
asked by 04.11.2017 / 16:59
1
answer

Change attribute of an array of objects in the state in the application

To try to make an attribute of one of the objects in an array of objects switch between true and false follow code: Initial status: constructor(props) { super(props) this.state = { post: [{ nome: '',...
asked by 17.07.2018 / 15:55
1
answer

How to convert an object to boolean in Ruby?

Objects in Ruby have some methods for rendering into another type, such as: to_s : convert to string to_a : convert to array to_i : convert to integer to_f : convert to float But there is no standard meth...
asked by 27.12.2017 / 04:09
1
answer

How to get return a boolean after a form.submit?

I have a customer registration form that runs the submit button on the register button: document.getElementById("formularioCadastro").submit(); All ok, the registration works, but I wanted to return a BOOLEAN true or false, to see if it was...
asked by 06.06.2017 / 20:41
2
answers

Index of the first negative number of a vector

I have to do a program in C that saves the index of the first negative number, but I can not do it. The question is this down: Construct a C program that enters 5 integers into an A vector, and print out the index of the first negative number...
asked by 18.06.2016 / 03:24
1
answer

How to check an ImagePattern of a Rectangle in JavaFX?

I'm trying to check in this method if my Square, which inherits from Rectangle, was filled with an ImagePattern via the getFill () function: public boolean HouseIsValid(House Square) { return (Square.getFill().equals(green) || Square.get...
asked by 17.12.2017 / 13:58
1
answer

Convert strings to booleans

I'm dynamically adding a javascript and to its src I need to pass some parameters ... the following function creates this "querystring": var querystring = {a:'b',b:true,c:'d',e:false}; var query = Object.keys(querystring).map((ke...
asked by 10.04.2017 / 00:11