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
android
phpword
merge
rdbms
angular-formly
jmx
fftw
obfuscation
composite-primary-key
mips
maxscript
google-cloud-datalab
frontend
pattern-matching
fabric.io
google-schemas
why3
datastage
jxl
openbugs
android-intent
docx
symfony-console
gmm
guzzle
cgbitmapcontext
libigl
php-mysqlidb
slidetoggle
syntax-highlighting
stackexchange
nstimer
8051
browser-sync
cart
erb
sammy.js
biztalk-rule-engine
activexobject
jwplayer6
swagger-php
odroid
sharp-snmp
lpsolve
importerror
facebook-social-plugins
pom.xml
automapper-5
chai-as-promised
openblas
yii2-user
jqchart
monkey
cmp
ziparchive
segment-io
adafruit
spring-cloud-feign
windows-azure-queues
eigenvector
freepbx
riot
upx
yajsw
ellucian-scribe
nio2
cycle2
spring-retry
inf
opl
flock
zen-cart
slash
airbrake
git-ftp
diff3
umlgraph
broadband
infosphere-spl
rmysql
create.js
codeplex
parallel-testing
rcaller
live555
ray
xmltodict
eclipse-kepler
notorm
http-status-code-410
fb.ui
alice
mkv
fragmenttransaction
zope.interface
rmiregistry
thttpd
multiplexing
window-decoration
cross-database
virtualpathprovider
agility.js
procedures
entity-attribute-value
landscape-portrait
unattended-processing
timertask
easyb
web-application-project
mathematical-notation
contentpresenter

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile