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
delphi-7
prism
codenvy
fpga
angular2-material
components
jwplayer
parameters
pyqt4
gembox-spreadsheet
bookmarks
echo
title
character
accessibility
minecraft-forge
octave
plist
stellar.js
supervisor
smartclient
enterprise-miner
articulate-storyline
r-mice
imageresizer
windows-server-2003
asymptotic-complexity
bringtofront
quantlib
jaws
carrierwave
alm
magento-1.8
gitlab-api
recurring-events
erb
mailkit
android-gridview
indy10
mnist
swagger-php
docfx
playframework-2.1
watchman
jpad
google-data-api
apache-stanbol
magento-1.9.3
xv6
wmp
signal-strength
vaadin-charts
dapper-simplecrud
vaadin-elements
getchar
httrack
jboss-4.2.x
yii2-api
mschart
geotiff
datamaps
truezip
reshape
visual-studio-2008-sp1
autosar
flex-monkey
async.js
mta
tooleap
cifilter
appscale
pre-build-event
shopping
jtwig
google-query-language
hadoop-partitioning
inf
java-money
include-guards
toolkit
alloy-ui
nutiteq
nsurlsessiondatatask
bufferedinputstream
jquery-forms-plugin
broadband
document-repository
crowd
jama
named-parameters
ora-00904
jquery-slider
android-audiorecord
scriptaculous
visual-studio-express
notorm
cocoalibspotify-2.0
scringo
process-explorer
octal
actiondispatch
midlet
xcode3.2
cuda-gdb
apache-whirr
box2d-iphone
update-statement
webdev.webserver
timthumb
dataform
django-paypal
commerceserver2007
timertask
tabpanel
filesystemobject
strtod
movieplayer
wspbuilder

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