grok


Grok Learning - 'Halve This'


I am having trouble solving the 'Halve This' problem on Grok Learning.
My code so far is:
x = int(input('Number: ')
f = float(x)
h = (f/2)
print(h)
But Grok is saying that the "f = float(x)" is incorrect. This message appears when I try to run the code:
File "program.py", line 2
f = float(x)
^
SyntaxError: invalid syntax
Can someone please tell me what is wrong or at best tell me the entire solution. This would be highly appreciated.
As #David Young said, try adding parenthesis on the first line.
x = int(input('Number: '))
f = float(x)
h = (f/2)
print(h)
you can also solve this without converting to float.
x = int(input('Number: '))
h = (f/2)
print(h)

Related Links

Grok Learning - 'Halve This'
logstash grok patterns assistance
Using multiple grok pattern to assign value to 1 field
Graylog cannot look a field as numeric
Logstatsh help needed to write grok filter
How to have timestamp as the only delimiter in Grok Logstach?
Error compiling Grok
logstash grok filter annoyance

Categories

HOME
telegram
jsf-2.2
solver
r-googlesheets
cakephp-3.4
babeljs
jetty
jax-ws
opengl-3
boto3
modal-dialog
bing-maps
pattern-matching
mql5
line
opengl-es-3.0
ipmitool
rtf
openbugs
speech-synthesis
mongodb-csharp
symbol
do-while
http-post
package.json
nodemcu
undertow
jquery-ias
systemtime
qliksense
slidetoggle
stackexchange
angular-translate
paperjs
ntp
autodesk-designautomation
code-snippets
openwhisk
python-pptx
imagenet
jpad
ideascript
jvmti
opensmpp
wmp
lpsolve
apache-spark-dataset
monkey-testing
openal
serde
globalize
identification
modelsim
subnet
backbone-collections
google-photos
javafx-css
change-tracking
autosar
hadoop-2.7.2
dotnetnuke-7
i386
delta
dimension
firebase-security
observablecollection
swizzling
omniauth-facebook
php-socket
gcloud-ruby
sklearn-pandas
toast
file-move
fuelcms
binomial-theorem
lasso
vacuum
apache-commons-daemon
keyup
bufferedinputstream
zxspectrum
public-html
exceldatareader
mass-assignment
android-cookiemanager
boost-program-options
ghcjs
pseudo-class
imagefilter
ora-00904
alternate
paste
maven-scm
dsym
qscrollarea
poker
virtual-pc
argouml
wimax
booksleeve
robotlegs
web-farm
zope.interface
saleslogix
listitem
luabind
user-tracking
webdev.webserver
msr
collectionviewsource
zend-rest
scrollbars
tui
application-planning
image-capture

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App