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
shell
uml
facebook-oauth
checkstyle
css3
phpmyadmin
swt
mstest
devise
shiro
r-googlesheets
access
bitbucket-api
soa
scripting
parameters
emscripten
jax-ws
frontend
nstableheaderview
categorical-data
octave
magnetic-cards
do-while
entitymanager
xmonad
shortest-path
breadth-first-search
dpdk
exit
object-storage
data.stackexchange.com
amazon-quicksight
exchangewebservices
browser-sync
mql
vex
winpe
database-comparison
turfjs
spring-security4
hard-drive
github3.py
openwhisk
sendbird
browser-extension
processwire
cin
magento-1.9.3
avcapturedevice
wc
apache-spark-dataset
flask-login
ntvs
mschart
vugen
activeperl
stdmap
rxtx
usart
dup
beanstalk
piracy-prevention
django-urls
evolus-pencil
lasso
google-refine
uvc
android-broadcast
rrule
java-security
ejb-2.x
angular-gettext
uncaught-typeerror
android-vibration
dot42
vsx
cfcache
synapse
kendo-dataviz
hidapi
android-icons
insert-id
wcf-configuration
boost-signals
infobright
apache-commons-dbutils
gobject-introspection
entitydatasource
django-paypal
collectionviewsource
updatesourcetrigger
easyb
murmurhash
feasibility
alsb
xpsdocument

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