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
url-redirection
hyperlink
forms
powerpoint
jelastic
package
cublas
pkcs#11
teechart
octave
nancy
dynatrace
http-post
internationalization
delphi-xe5
gmm
jquery-ias
pagespeed
resourcebundle
linked-data
tpm
comparable
bioinformatics
aws-codecommit
dumpbin
jbutton
papaparse
mailkit
linkedhashmap
jett
dsx-desktop
hard-drive
github3.py
python-import
pdw-file-browser
jwplayer6
latitude-longitude
magento-1.9.2.4
linq-to-objects
metawidget
stringtokenizer
dbnull
apollostack
contract
signal-strength
identification
backbone-collections
opengl-4
skin
oozie-coordinator
flac
testrail
gets
pytables
meteor-packages
stax
redistributable
macaulay2
mta
expectations
nss
bizagi
sklearn-pandas
kendo-upload
concept-insights
wiredep
google-books
rubaxa-sortable
coda
cgi-bin
sha512
cryptographichashfunction
contrast
iso-prolog
appserver
mdichild
functional-java
gnumeric
android-framework
extjs2
koala
multitasking
high-resolution
gd-graph
mbunit
hidapi
process-explorer
onload-event
iboutlet
pyunit
infobright
hibernateexception
google-floodlight
jqote
msr
load-time
ajax-polling
tui
visualj#
fault-tolerance
soappy
great-circle
netbeans6.1

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile