Posts by Roberto • 219 points
6 posts
-
9
votes7
answers49622
viewsQ: How to add elements from a list and return the result as an integer?
I need to define the function soma_elementos This function takes a list of integer numbers and returns an integer corresponding to the sum of the elements of the received list. How do I do this? def…
-
0
votes0
answers1384
viewsQ: NIM game - PYTHON
My question wasn’t so clear last time, so I decided to redo it here, and I think I know where I’m going wrong, but I don’t know what I’m going wrong. In the question it says: "You must write a…
-
-1
votes2
answers2029
viewsQ: PYTHON - NIM game (problem with computer fix starting or not)
Goal You must write a program in the Python language, version 3, that allows a "victim" to play the NIM against the computer. The computer, of course, must follow the winning strategy described…
-
6
votes3
answers6745
viewsQ: How to validate whether it is a vowel without writing all the letters of the alphabet
Write the vowel function that takes a single character as a parameter and return True if it is a vowel and False if it is a consonant. Note that vowel("a") must return True vowel("b") must return…
-
0
votes6
answers14517
viewsQ: How to define the largest prime number within a given number?
For example, you give the number 100 and the highest prime number within 100 is 97. How can I program this? "Write the maior_prime function that takes an integer number greater than or equal to 2 as…
-
7
votes11
answers37801
viewsQ: Compute sum of digits of a number
Type a program that receives an integer number in the input, calculate and print the sum of the digits of this number in the output. Example: >>> Digite um número inteiro: 123 6 Tip: To…