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
adal
hyperlink
design-patterns
nvd3.js
webdriver
amp-html
static
socket.io
sublimetext
appcelerator
replace
ms-access-2016
scripting
square
interpolation
tvos
computer-science
accessibility
sendgrid-api-v3
appcelerator-studio
watson-conversation
activecollab
xcodebuild
onedrive-api
scsi
soci
pyramid
drive
googlebot
imagemap
ios10.2
postscript
joptionpane
short-url
monit
moses
entity-relationship-model
tpm
subclass
cppreference
scrollview
powershell-ise
hibernate-validator
memory-address
biztalk-rule-engine
joomla2.5
slacktextviewcontroller
processwire
apic
lint
android-augmented-reality
railstutorial.org
demo
opensmpp
resolution
postgresql-8.4
subclipse
apollostack
tcc
android-checkbox
android-exoplayer
openal
openrasta
wcftestclient
vugen
openblas
static-cast
excel-dna
reachability
macaulay2
cifilter
xdoclet
appscale
turbo-prolog
upx
yajsw
libvlc
xenomai
visual-sourcesafe-2005
ansi
java-security
showdialog
metatrader5
webfinger
teaspoon
lambda-architecture
build-script
functional-java
renderer
dsym
sbcl
ecslidingviewcontroller
mbunit
modular
facebook-timeline
resource-management
dopostback
vfs
extconf.rb
window-decoration
urlrewriter
luabind
entity-attribute-value
openfaces
lalr
xpsdocument
xslcompiledtransform
blind
image-capture

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