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
kentico
scikit-learn
c99
android-studio-2.2
depth
socket.io
ms-access-2016
database-normalization
hugo
data-visualization
vert.x
openpyxl
java.util.logging
selenium-ide
symmetricds
replication
simpleitk
question2answer
pagespeed
r-mice
fractions
handler
carrierwave
custom-controls
complex-numbers
git-squash
catch-unit-test
linkedhashmap
openwhisk
reactjs.net
fossil
modalviewcontroller
processwire
servicestack-text
reason
imagenet
filesystemwatcher
google-data-api
unordered-map
glm-math
smoothstate.js
servermanager
avx
er-diagram
reshape
materialized-path-pattern
smartfoxserver
windows-azure-queues
beamer
dimension
lean
udpclient
redis-cluster
nullable
contentcontrol
grgit
wiredep
microsoft-reporting
rate-limiting
binomial-theorem
canalyzer
osc
showdialog
primitive-types
sonarqube-5.0
build-script
kissfft
high-resolution
kendo-dataviz
inappsettingskit
node-blade
dolby-audio-api
traceability
twisted.web
argouml
fragmenttransaction
correlated-subquery
apache-whirr
failing-tests
virtualpathprovider
expression-blend-4
saxparseexception
fsevents
xcelsius
mysql-error-1205
mbeans
svk
squishit
web-garden
data-mapping
tui
httpcookie

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